summaryrefslogtreecommitdiff
path: root/perlio.c
diff options
context:
space:
mode:
authorNick Ing-Simmons <nik@tiuk.ti.com>2003-02-01 11:56:47 +0000
committerNick Ing-Simmons <nik@tiuk.ti.com>2003-02-01 11:56:47 +0000
commitbbfd922f5bb0c97d0accf18f588b887418c94e6b (patch)
tree1f8d40504d5d7f2ea320a3e56f833e9b21af1387 /perlio.c
parente468d35bbed7491e8b221d65181da6200264b6a0 (diff)
downloadperl-bbfd922f5bb0c97d0accf18f588b887418c94e6b.tar.gz
fflush() before invalidating stdio's fileno.
p4raw-id: //depot/perlio@18613
Diffstat (limited to 'perlio.c')
-rw-r--r--perlio.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/perlio.c b/perlio.c
index 25c13804e6..9cb12d0e60 100644
--- a/perlio.c
+++ b/perlio.c
@@ -2795,7 +2795,7 @@ PerlIOStdio_close(pTHX_ PerlIO *f)
int fd = fileno(stdio);
int socksfd = 0;
int invalidate = 0;
- IV result;
+ IV result = 0;
int saveerr = 0;
int dupfd = 0;
#ifdef SOCKS5_VERSION_NAME
@@ -2830,6 +2830,7 @@ PerlIOStdio_close(pTHX_ PerlIO *f)
Use Sarathy's trick from maint-5.6 to invalidate the
fileno slot of the FILE *
*/
+ result = PerlIO_flush(f);
saveerr = errno;
if (!(invalidate = PerlIOStdio_invalidate_fileno(aTHX_ stdio))) {
dupfd = PerlLIO_dup(fd);