summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c13
1 files changed, 3 insertions, 10 deletions
diff --git a/perlio.c b/perlio.c
index 06a360b9b1..a5d4377350 100644
--- a/perlio.c
+++ b/perlio.c
@@ -5090,16 +5090,9 @@ PerlIO_tmpfile(void)
# else /* !HAS_MKSTEMP, fallback to stdio tmpfile(). */
FILE * const stdio = PerlSIO_tmpfile();
- if (stdio) {
- if ((f = PerlIO_push(aTHX_(PerlIO_allocate(aTHX)),
- PERLIO_FUNCS_CAST(&PerlIO_stdio),
- "w+", NULL))) {
- PerlIOStdio * const s = PerlIOSelf(f, PerlIOStdio);
-
- if (s)
- s->stdio = stdio;
- }
- }
+ if (stdio)
+ f = PerlIO_fdopen(fileno(stdio), "w+");
+
# endif /* else HAS_MKSTEMP */
#endif /* else WIN32 */
return f;