diff options
author | Zefram <zefram@fysh.org> | 2017-12-20 04:29:29 +0000 |
---|---|---|
committer | Zefram <zefram@fysh.org> | 2017-12-22 16:34:10 +0000 |
commit | 0b5984d31e65cdc461bcae69276cde68b94d33e0 (patch) | |
tree | 8ecb0fffb5a6d80445eb12b4fd1351394458c13a /perlio.c | |
parent | d681a35f3ad739de2b1521a127a810eb029ee514 (diff) | |
download | perl-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.c | 8 |
1 files changed, 4 insertions, 4 deletions
@@ -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) { |