summaryrefslogtreecommitdiff
path: root/win32/win32.c
diff options
context:
space:
mode:
authorGurusamy Sarathy <gsar@cpan.org>2003-06-02 18:44:34 +0000
committerGurusamy Sarathy <gsar@cpan.org>2003-06-02 18:44:34 +0000
commit3a8ae1affddf8a9aac8746965f2ae13c7af42aba (patch)
treed36a43ec45b7cbc3b84eed59b4d0bfc171cc457d /win32/win32.c
parentdc694082e66bcad1c2faeb08a1c5832719339050 (diff)
downloadperl-3a8ae1affddf8a9aac8746965f2ae13c7af42aba.tar.gz
don't use File::Temp to implement PerlIO_tmpfile() on windows;
reuse the straightforward native implementation instead this fixes the warning from io_xs.t NOTE: File::Temp has a less-than-robust implementation on windows that relies on END blocks being run (this may not happen always) p4raw-id: //depot/perl@19667
Diffstat (limited to 'win32/win32.c')
-rw-r--r--win32/win32.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/win32/win32.c b/win32/win32.c
index c40920332d..d059fe2773 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -2615,8 +2615,8 @@ win32_rewind(FILE *pf)
return;
}
-DllExport FILE*
-win32_tmpfile(void)
+DllExport int
+win32_tmpfd(void)
{
dTHX;
char prefix[MAX_PATH+1];
@@ -2640,11 +2640,20 @@ win32_tmpfile(void)
#endif
DEBUG_p(PerlIO_printf(Perl_debug_log,
"Created tmpfile=%s\n",filename));
- return fdopen(fd, "w+b");
+ return fd;
}
}
}
}
+ return -1;
+}
+
+DllExport FILE*
+win32_tmpfile(void)
+{
+ int fd = win32_tmpfd();
+ if (fd >= 0)
+ return win32_fdopen(fd, "w+b");
return NULL;
}