Module Name: src
Committed By: njoly
Date: Thu Oct 20 18:18:21 UTC 2011
Modified Files:
src/sys/kern: sys_pipe.c
Log Message:
Do call fd_set_exclose() on both file descriptors, to set the
close-on-exec flag.
To generate a diff of this commit:
cvs rdiff -u -r1.133 -r1.134 src/sys/kern/sys_pipe.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/kern/sys_pipe.c
diff -u src/sys/kern/sys_pipe.c:1.133 src/sys/kern/sys_pipe.c:1.134
--- src/sys/kern/sys_pipe.c:1.133 Wed Oct 5 13:30:24 2011
+++ src/sys/kern/sys_pipe.c Thu Oct 20 18:18:21 2011
@@ -1,4 +1,4 @@
-/* $NetBSD: sys_pipe.c,v 1.133 2011/10/05 13:30:24 apb Exp $ */
+/* $NetBSD: sys_pipe.c,v 1.134 2011/10/20 18:18:21 njoly Exp $ */
/*-
* Copyright (c) 2003, 2007, 2008, 2009 The NetBSD Foundation, Inc.
@@ -68,7 +68,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: sys_pipe.c,v 1.133 2011/10/05 13:30:24 apb Exp $");
+__KERNEL_RCSID(0, "$NetBSD: sys_pipe.c,v 1.134 2011/10/20 18:18:21 njoly Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -271,6 +271,7 @@ pipe1(struct lwp *l, register_t *retval,
rf->f_type = DTYPE_PIPE;
rf->f_data = (void *)rpipe;
rf->f_ops = &pipeops;
+ fd_set_exclose(l, fd, (flags & O_CLOEXEC) != 0);
error = fd_allocfile(&wf, &fd);
if (error)
@@ -280,6 +281,7 @@ pipe1(struct lwp *l, register_t *retval,
wf->f_type = DTYPE_PIPE;
wf->f_data = (void *)wpipe;
wf->f_ops = &pipeops;
+ fd_set_exclose(l, fd, (flags & O_CLOEXEC) != 0);
rpipe->pipe_peer = wpipe;
wpipe->pipe_peer = rpipe;