Subject: bug#1107: #1107 - 23.0.60; Emacs --daemon crashes when emacsclient tries to establish a connection on OS X - Emacs bug report logs

From: Dan Nicolaescu <[email-masked]>
Date: Tue, 9 Dec 2008 22:58:37 -0800 (PST)

Adrian Robert <[email-masked]> writes:

  > I have not had the chance to refine my fix so I'm attaching my patch  
  > here in hopes that someone else can work on it.  It uses exec()  
  > instead of fork() to launch the child, using a daemon name argument to  
  > differentiate the child.  This prevents normal use of the name  
  > argument.  Moreover, the pipe connection does not work (not sure why),  
  > so it is disabled.
  > 
  > Index: src/emacs.c
  > ===================================================================
  > RCS file: /sources/emacs/emacs/src/emacs.c,v
  > retrieving revision 1.456
  > diff -u -p -r1.456 emacs.c
  > --- src/emacs.c	8 Dec 2008 16:22:40 -0000	1.456
  > +++ src/emacs.c	10 Dec 2008 04:16:16 -0000
  > @@ -1102,21 +1102,26 @@ main (int argc, char **argv)
  >   	 use a pipe for synchronization.  The parent waits for the child
  >   	 to close its end of the pipe (using `daemon-initialized')
  >   	 before exiting.  */
  > +#ifndef HAVE_NS

Is this a problem just for MacOSX or also for GNUStep?
All these #ifdefs are very ugly, IMHO it would be better to separate the
NS functionality in a different function, that way only a single #ifdef
is needed here.