From: Jarkko Hietaniemi Date: Mon, 2 Jun 2003 08:54:04 +0000 (+0000) Subject: Stick with the original (5.8.0) logic. X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=96d9c00335ae295073be6079101e1a3951c3149f;p=p5sagit%2Fp5-mst-13.2.git Stick with the original (5.8.0) logic. p4raw-id: //depot/perl@19657 --- diff --git a/op.c b/op.c index 4d64d83..c52f4fc 100644 --- a/op.c +++ b/op.c @@ -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. */