This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
use O_CLOEXEC when making fake empty device
authorZefram <zefram@fysh.org>
Wed, 20 Dec 2017 04:05:23 +0000 (04:05 +0000)
committerZefram <zefram@fysh.org>
Fri, 22 Dec 2017 16:33:59 +0000 (16:33 +0000)
perl.c

diff --git a/perl.c b/perl.c
index e6932b5..2fca0f4 100644 (file)
--- a/perl.c
+++ b/perl.c
@@ -4032,7 +4032,7 @@ S_open_script(pTHX_ const char *scriptname, bool dosearch, bool *suidscript)
        };
        const char * const err = "Failed to create a fake bit bucket";
        if (strEQ(scriptname, BIT_BUCKET)) {
-           int tmpfd = Perl_my_mkstemp(tmpname);
+           int tmpfd = Perl_my_mkstemp_cloexec(tmpname);
            if (tmpfd > -1) {
                scriptname = tmpname;
                close(tmpfd);