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
[perl5.git] / 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);