summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorZefram <zefram@fysh.org>2017-12-20 04:29:29 +0000
committerZefram <zefram@fysh.org>2017-12-22 16:34:10 +0000
commit0b5984d31e65cdc461bcae69276cde68b94d33e0 (patch)
tree8ecb0fffb5a6d80445eb12b4fd1351394458c13a /perlio.c
parentd681a35f3ad739de2b1521a127a810eb029ee514 (diff)
downloadperl-0b5984d31e65cdc461bcae69276cde68b94d33e0.tar.gz
set FD_CLOEXEC on PL_perlio_debug_fd
There's clearly no intent for this to be inherited across exec.
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/perlio.c b/perlio.c
index d9fdac3f90..fa9f54feda 100644
--- a/perlio.c
+++ b/perlio.c
@@ -355,14 +355,14 @@ PerlIO_debug(const char *fmt, ...)
PerlProc_getgid() == PerlProc_getegid()) {
const char * const s = PerlEnv_getenv("PERLIO_DEBUG");
if (s && *s)
- PL_perlio_debug_fd
- = PerlLIO_open3(s, O_WRONLY | O_CREAT | O_APPEND, 0666);
+ PL_perlio_debug_fd = PerlLIO_open3_cloexec(s,
+ O_WRONLY | O_CREAT | O_APPEND, 0666);
else
- PL_perlio_debug_fd = PerlLIO_dup(2); /* stderr */
+ PL_perlio_debug_fd = PerlLIO_dup_cloexec(2); /* stderr */
} else {
/* tainting or set*id, so ignore the environment and send the
debug output to stderr, like other -D switches. */
- PL_perlio_debug_fd = PerlLIO_dup(2); /* stderr */
+ PL_perlio_debug_fd = PerlLIO_dup_cloexec(2); /* stderr */
}
}
if (PL_perlio_debug_fd > 0) {