Subject: Re: bug#1058: 23.0.60; emacs --daemon should not return until socket is ready

From: Dan Nicolaescu <[email-masked]>
Date: Thu, 2 Oct 2008 01:14:39 -0700 (PDT)

Romain Francoise <[email-masked]> writes:

  > Dan Nicolaescu <[email-masked]> writes:
  > 
  > > It would be much better if this could be done without a state
  > > changing function callable from elisp.
  > 
  > I agree, but given that control passes to Lisp pretty early, I don't
  > see how it can be done.

That's exactly the reason for my initial reply...

Anyway, your patch probably needs an approval from a maintainer.

And a better name and docstring for daemon-detach-parent would be
needed.
Also daemon-detach-parent should throw an error if called in the non-daemon
case, and when called more than once.
More comments explaining what's going on would also be nic.
Maybe use select instead of read+sleep?
Or signals?
Should also do something in case the child dies before it calls
daemon-detach-parent.