summaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorThomas Klausner <wiz@NetBSD.org>2015-02-25 22:22:50 +0100
committerThomas Klausner <wiz@NetBSD.org>2015-02-28 18:19:52 +0100
commit6c335e1c315a68283b1303afb06a3d5a34adab83 (patch)
treed2b09dcf66bbae97a29130ee2d9ed3e731053f57 /remote.c
parent0caed2fbce401e48d55ebfeda968e9ea8012f01d (diff)
Close file descriptors on exec.
Reviewed-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Thomas Klausner <wiz@NetBSD.org>
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/remote.c b/remote.c
index 54d95ac..3fb21ec 100644
--- a/remote.c
+++ b/remote.c
@@ -111,7 +111,8 @@ remote_start(const char *restart_protocol, const char *restart_machine,
default: /* parent */
close (pipefd[0]);
- fp = (FILE *) fdopen (pipefd[1], "w");
+ fcntl(pipefd[1], F_SETFD, FD_CLOEXEC);
+ fp = fdopen (pipefd[1], "w");
fprintf (fp, "CONTEXT X\n");
fprintf (fp, "DIR %s\n", cwd);