summaryrefslogtreecommitdiff
path: root/pp_sys.c
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2017-12-22 15:20:26 +0000
committerZefram <zefram@fysh.org>2017-12-22 16:34:17 +0000
commit2cdf406af42834c46ef407517daab0734f7066fc (patch)
treefebf816e9fc053ffbd418f40e89587add454fcfe /pp_sys.c
parent0b5984d31e65cdc461bcae69276cde68b94d33e0 (diff)
downloadperl-2cdf406af42834c46ef407517daab0734f7066fc.tar.gz
make PerlIO handle FD_CLOEXEC
Move handling of close-on-exec flag for PerlIO handles into PerlIO itself. Where PerlIO opens new file descriptors, have them opened in O_CLOEXEC mode where possible.
Diffstat (limited to 'pp_sys.c')
-rw-r--r--pp_sys.c6
1 files changed, 0 insertions, 6 deletions
diff --git a/pp_sys.c b/pp_sys.c
index c2873b8e08..0c9147bc4e 100644
--- a/pp_sys.c
+++ b/pp_sys.c
@@ -692,8 +692,6 @@ PP(pp_pipe_op)
if (PerlProc_pipe_cloexec(fd) < 0)
goto badexit;
- setfd_inhexec_for_sysfd(fd[0]);
- setfd_inhexec_for_sysfd(fd[1]);
IoIFP(rstio) = PerlIO_fdopen(fd[0], "r" PIPE_OPEN_MODE);
IoOFP(wstio) = PerlIO_fdopen(fd[1], "w" PIPE_OPEN_MODE);
@@ -2521,7 +2519,6 @@ PP(pp_socket)
if (fd < 0) {
RETPUSHUNDEF;
}
- setfd_inhexec_for_sysfd(fd);
IoIFP(io) = PerlIO_fdopen(fd, "r" SOCKET_OPEN_MODE); /* stdio gets confused about sockets */
IoOFP(io) = PerlIO_fdopen(fd, "w" SOCKET_OPEN_MODE);
IoTYPE(io) = IoTYPE_SOCKET;
@@ -2558,8 +2555,6 @@ PP(pp_sockpair)
TAINT_PROPER("socketpair");
if (PerlSock_socketpair_cloexec(domain, type, protocol, fd) < 0)
RETPUSHUNDEF;
- setfd_inhexec_for_sysfd(fd[0]);
- setfd_inhexec_for_sysfd(fd[1]);
IoIFP(io1) = PerlIO_fdopen(fd[0], "r" SOCKET_OPEN_MODE);
IoOFP(io1) = PerlIO_fdopen(fd[0], "w" SOCKET_OPEN_MODE);
IoTYPE(io1) = IoTYPE_SOCKET;
@@ -2675,7 +2670,6 @@ PP(pp_accept)
if (fd < 0)
goto badexit;
- setfd_inhexec_for_sysfd(fd);
if (IoIFP(nstio))
do_close(ngv, FALSE);
IoIFP(nstio) = PerlIO_fdopen(fd, "r" SOCKET_OPEN_MODE);