summaryrefslogtreecommitdiff
path: root/perl.c
diff options
context:
space:
mode:
Diffstat (limited to 'perl.c')
-rw-r--r--perl.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/perl.c b/perl.c
index 5c839f3900..d39bb1b466 100644
--- a/perl.c
+++ b/perl.c
@@ -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