diff options
author | Jarkko Hietaniemi <jhi@iki.fi> | 2003-06-03 09:51:59 +0000 |
---|---|---|
committer | Jarkko Hietaniemi <jhi@iki.fi> | 2003-06-03 09:51:59 +0000 |
commit | 2941a2e1ed23bc0518b5a6191536ac96286a18c1 (patch) | |
tree | 2770a44b45855a7cc1685884567f2c83da85ee6b /win32 | |
parent | f253e8355cf4011cc78385c0bd36c23d15d3d892 (diff) | |
download | perl-2941a2e1ed23bc0518b5a6191536ac96286a18c1.tar.gz |
Salvage parts of #19667.
p4raw-id: //depot/perl@19673
Diffstat (limited to 'win32')
-rw-r--r-- | win32/win32.c | 15 | ||||
-rw-r--r-- | win32/win32iop.h | 1 |
2 files changed, 13 insertions, 3 deletions
diff --git a/win32/win32.c b/win32/win32.c index b022e0cfc0..083e98e797 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; } diff --git a/win32/win32iop.h b/win32/win32iop.h index e835b2eea6..1683e97e54 100644 --- a/win32/win32iop.h +++ b/win32/win32iop.h @@ -67,6 +67,7 @@ DllExport int win32_fseek(FILE *pf,Off_t offset,int origin); DllExport int win32_fgetpos(FILE *pf,fpos_t *p); DllExport int win32_fsetpos(FILE *pf,const fpos_t *p); DllExport void win32_rewind(FILE *pf); +DllExport int win32_tmpfd(void); DllExport FILE* win32_tmpfile(void); DllExport void win32_abort(void); DllExport int win32_fstat(int fd,Stat_t *sbufptr); |