diff options
Diffstat (limited to 'perl.c')
-rw-r--r-- | perl.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -842,7 +842,7 @@ perl_destruct(pTHXx) back into Perl_debug_log, as if we never actually closed it */ if(got_fd != debug_fd) { - if (PerlLIO_dup2_cloexec(got_fd, debug_fd) == -1) { + if (dup2(got_fd, debug_fd) == -1) { where = "dup2"; goto abort; } @@ -4075,6 +4075,8 @@ S_open_script(pTHX_ const char *scriptname, bool dosearch, bool *suidscript) CopFILE(PL_curcop), Strerror(errno)); } fd = PerlIO_fileno(rsfp); + if (fd >= 0) + setfd_cloexec(fd); if (fd < 0 || (PerlLIO_fstat(fd, &tmpstatbuf) >= 0 |