Commit 7c19d3ae authored by Dan Nicolaescu's avatar Dan Nicolaescu

(main): Close daemon_pipe on exec.

parent d31eee5e
2008-12-08 Dan Nicolaescu <dann@ics.uci.edu>
* emacs.c (main): Close daemon_pipe on exec.
2008-12-08 Chong Yidong <cyd@stupidchicken.com> 2008-12-08 Chong Yidong <cyd@stupidchicken.com>
* termchar.h (struct tty): New members termcap_term_buffer and * termchar.h (struct tty): New members termcap_term_buffer and
......
...@@ -1143,6 +1143,10 @@ main (int argc, char **argv) ...@@ -1143,6 +1143,10 @@ main (int argc, char **argv)
daemon_name = xstrdup (dname_arg); daemon_name = xstrdup (dname_arg);
/* Close unused reading end of the pipe. */ /* Close unused reading end of the pipe. */
close (daemon_pipe[0]); close (daemon_pipe[0]);
/* Make sure that the used end of the pipe is closed on exec, so
that it is not accessible to programs started from .emacs. */
fcntl (daemon_pipe[1], F_SETFD, FD_CLOEXEC);
#ifdef HAVE_SETSID #ifdef HAVE_SETSID
setsid(); setsid();
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment