diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-06-02 08:54:04 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-06-02 08:54:04 +0000 |
commit | 96d9c00335ae295073be6079101e1a3951c3149f (patch) | |
tree | 014d298a5ae2cb10c7c4ddad7c75377254ff7c9e /op.c | |
parent | de72a0a2f83a7d3d3d50d7d56d6f442eb3778175 (diff) | |
download | perl-96d9c00335ae295073be6079101e1a3951c3149f.tar.gz |
Stick with the original (5.8.0) logic.
p4raw-id: //depot/perl@19657
Diffstat (limited to 'op.c')
-rw-r--r-- | op.c | 22 |
1 files changed, 11 insertions, 11 deletions
@@ -6520,7 +6520,16 @@ Perl_my_tmpfp(pTHX) #ifdef PERL_EXTERNAL_GLOB /* File::Temp pulls in Fcntl, which may not be available with * e.g. miniperl, use mkstemp() or stdio tmpfile() instead. */ -# ifdef HAS_MKSTEMP +# if defined(WIN32) || !defined(HAS_MKSTEMP) + FILE *stdio = PerlSIO_tmpfile(); + if (stdio) { + if ((f = PerlIO_push(aTHX_(PerlIO_allocate(aTHX)), + &PerlIO_stdio, "w+", Nullsv))) { + PerlIOStdio *s = PerlIOSelf(f, PerlIOStdio); + s->stdio = stdio; + } + } +# else /* !WIN32 && HAS_MKSTEMP */ SV *sv = newSVpv("/tmp/PerlIO_XXXXXX", 0); fd = mkstemp(SvPVX(sv)); if (fd >= 0) { @@ -6530,16 +6539,7 @@ Perl_my_tmpfp(pTHX) SvREFCNT_dec(sv); } } -# else - FILE *stdio = PerlSIO_tmpfile(); - if (stdio) { - if ((f = PerlIO_push(aTHX_(PerlIO_allocate(aTHX)), - &PerlIO_stdio, "w+", Nullsv))) { - PerlIOStdio *s = PerlIOSelf(f, PerlIOStdio); - s->stdio = stdio; - } - } -# endif /* HAS_MKSTEMP */ +# endif /* WIN32 || !HAS_MKSTEMP */ #else /* We have internal glob, which probably also means that we * can also use File::Temp (which uses Fcntl) with impunity. */ |