From: Paul Eggert Date: Sat, 28 Dec 2013 22:56:58 +0000 (-0800) Subject: Fix pipe bug with OS X emacs --daemon (Bug#16262). X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~139 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=411bf4a486ae5bfe32b8e10c6293f525905c0049;p=emacs.git Fix pipe bug with OS X emacs --daemon (Bug#16262). * emacs.c (main) [DAEMON_MUST_EXEC]: Clear the close-on-exec flags on the daemon pipe ends before execing. --- diff --git a/src/ChangeLog b/src/ChangeLog index 2749399d392..1ec84a72d2d 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2013-12-28 Paul Eggert + + Fix pipe bug with OS X emacs --daemon (Bug#16262). + * emacs.c (main) [DAEMON_MUST_EXEC]: Clear the close-on-exec + flags on the daemon pipe ends before execing. + 2013-12-28 Eli Zaretskii * w32fns.c (Fx_create_frame): Error out if called from a TTY diff --git a/src/emacs.c b/src/emacs.c index 35e8ff330c9..b5bd3129ad2 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -1099,6 +1099,8 @@ Using an Emacs configured with --with-x-toolkit=lucid does not have this problem argv[skip_args] = fdStr; + fcntl (daemon_pipe[0], F_SETFD, 0); + fcntl (daemon_pipe[1], F_SETFD, 0); execvp (argv[0], argv); emacs_perror (argv[0]); exit (errno == ENOENT ? EXIT_ENOENT : EXIT_CANNOT_INVOKE);