summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>1998-11-08 02:52:52 +0000
committerGurusamy Sarathy <gsar@cpan.org>1998-11-08 02:52:52 +0000
commit4771b018b5cdc984c08bd1fd014895ea804ec3f0 (patch)
treed7dbd29220af60de0b50dec1fcdfed3ada62e856 /pp_sys.c
parent4a76a316da914ce6cc5c2d7af1dfcd312f3ea6db (diff)
downloadperl-4771b018b5cdc984c08bd1fd014895ea804ec3f0.tar.gz
set close-on-exec bit on pipe() FDs
p4raw-id: //depot/perl@2215
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/pp_sys.c b/pp_sys.c
index 7ae628bfb2..96ecd5875c 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -572,7 +572,10 @@ PP(pp_pipe_op)
else PerlLIO_close(fd[1]);
goto badexit;
}
-
+#if defined(HAS_FCNTL) && defined(F_SETFD)
+ fcntl(fd[0],F_SETFD,fd[0] > PL_maxsysfd); /* ensure close-on-exec */
+ fcntl(fd[1],F_SETFD,fd[1] > PL_maxsysfd); /* ensure close-on-exec */
+#endif
RETPUSHYES;
badexit: