diff options
author | Zefram <zefram@fysh.org> | 2017-12-19 18:50:32 +0000 |
---|---|---|
committer | Zefram <zefram@fysh.org> | 2017-12-22 16:26:38 +0000 |
commit | d333cbeb476c54aaf8f85ffdcfc187f23b4ea2ee (patch) | |
tree | f4ccafab5d5661caa83ff8da54e4d67b02f96aaa /perl.c | |
parent | 2517ba9951b6aed3ab780dc0247c90deff825b4e (diff) | |
download | perl-d333cbeb476c54aaf8f85ffdcfc187f23b4ea2ee.tar.gz |
use Perl_my_mkstemp() where appropriate
Since commit e48855bdd2fc57fc51156f5e4b8dee6b544456c8 there has been
no need to be conditional about using mkstemp(). Perl_my_mkstemp()
is always available, one way or another.
Diffstat (limited to 'perl.c')
-rw-r--r-- | perl.c | 6 |
1 files changed, 1 insertions, 5 deletions
@@ -4032,16 +4032,12 @@ 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)) { -#ifdef HAS_MKSTEMP /* Hopefully mkstemp() is safe here. */ - int old_umask = umask(0177); - int tmpfd = mkstemp(tmpname); - umask(old_umask); + int tmpfd = Perl_my_mkstemp(tmpname); if (tmpfd > -1) { scriptname = tmpname; close(tmpfd); } else Perl_croak(aTHX_ err); -#endif } #endif rsfp = PerlIO_open(scriptname,PERL_SCRIPT_MODE); |