]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix pipe bug with OS X emacs --daemon (Bug#16262).
authorPaul Eggert <eggert@cs.ucla.edu>
Sat, 28 Dec 2013 22:56:58 +0000 (14:56 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Sat, 28 Dec 2013 22:56:58 +0000 (14:56 -0800)
* emacs.c (main) [DAEMON_MUST_EXEC]: Clear the close-on-exec
flags on the daemon pipe ends before execing.

src/ChangeLog
src/emacs.c

index 2749399d3921e150c5548d8d3c83beb52dd0781f..1ec84a72d2d8d2c56a753be8ab27898c86fee760 100644 (file)
@@ -1,3 +1,9 @@
+2013-12-28  Paul Eggert  <eggert@cs.ucla.edu>
+
+       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  <eliz@gnu.org>
 
        * w32fns.c (Fx_create_frame): Error out if called from a TTY
index 35e8ff330c9ea26d5dfe2356c17f5a4110787e69..b5bd3129ad2daca2bce2698416d32209612cced1 100644 (file)
@@ -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);