PERLIO=perlio passes all tests.
PERLIO=stdio (sadly the default) hangs in t.pragma/warnings.t #319
p4raw-id: //depot/perlio@7796
oflags |= O_WRONLY;
break;
}
+ if (*mode == 'b')
+ {
+ oflags |= O_BINARY;
+ mode++;
+ }
if (*mode || oflags == -1)
{
errno = EINVAL;
PerlIO *
PerlIO_tmpfile(void)
{
- dTHX;
/* I have no idea how portable mkstemp() is ... */
+#if defined(WIN32) || !defined(HAVE_MKSTEMP)
+ PerlIO *f = NULL;
+ FILE *stdio = tmpfile();
+ if (stdio)
+ {
+ PerlIOStdio *s = PerlIOSelf(PerlIO_push(f = PerlIO_allocate(),&PerlIO_stdio,"w+"),PerlIOStdio);
+ s->stdio = stdio;
+ }
+ return f;
+#else
+ dTHX;
SV *sv = newSVpv("/tmp/PerlIO_XXXXXX",0);
int fd = mkstemp(SvPVX(sv));
PerlIO *f = NULL;
SvREFCNT_dec(sv);
}
return f;
+#endif
}
#undef HAS_FSETPOS
* process termination or call to FreeLibrary.
*/
case DLL_PROCESS_DETACH:
+ PerlIO_cleanup();
EndSockets();
#if defined(USE_THREADS) || defined(USE_ITHREADS)
if (PL_curinterp)
}
/* we have an fd, return a file stream */
-#ifdef USE_PERLIO
return (PerlIO_fdopen(p[parent], (char *)mode));
-#else
- return (fdopen(p[parent], (char *)mode));
-#endif
cleanup:
/* we don't need to check for errors here */