diff options
| -rw-r--r-- | src/ChangeLog | 4 | ||||
| -rw-r--r-- | src/emacs.c | 4 |
2 files changed, 8 insertions, 0 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 2fe9652070b..1eb0c5f02ea 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,7 @@ | |||
| 1 | 2008-12-08 Dan Nicolaescu <dann@ics.uci.edu> | ||
| 2 | |||
| 3 | * emacs.c (main): Close daemon_pipe on exec. | ||
| 4 | |||
| 1 | 2008-12-08 Chong Yidong <cyd@stupidchicken.com> | 5 | 2008-12-08 Chong Yidong <cyd@stupidchicken.com> |
| 2 | 6 | ||
| 3 | * termchar.h (struct tty): New members termcap_term_buffer and | 7 | * termchar.h (struct tty): New members termcap_term_buffer and |
diff --git a/src/emacs.c b/src/emacs.c index b4d09ac5d2d..bd733da303f 100644 --- a/src/emacs.c +++ b/src/emacs.c | |||
| @@ -1143,6 +1143,10 @@ main (int argc, char **argv) | |||
| 1143 | daemon_name = xstrdup (dname_arg); | 1143 | daemon_name = xstrdup (dname_arg); |
| 1144 | /* Close unused reading end of the pipe. */ | 1144 | /* Close unused reading end of the pipe. */ |
| 1145 | close (daemon_pipe[0]); | 1145 | close (daemon_pipe[0]); |
| 1146 | /* Make sure that the used end of the pipe is closed on exec, so | ||
| 1147 | that it is not accessible to programs started from .emacs. */ | ||
| 1148 | fcntl (daemon_pipe[1], F_SETFD, FD_CLOEXEC); | ||
| 1149 | |||
| 1146 | #ifdef HAVE_SETSID | 1150 | #ifdef HAVE_SETSID |
| 1147 | setsid(); | 1151 | setsid(); |
| 1148 | #endif | 1152 | #endif |