From: Nick Ing-Simmons Date: Sat, 1 Feb 2003 13:03:52 +0000 (+0000) Subject: Re: bleadperl: PerlIOStdio_invalidate_fileno breaks fclose semantics X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=commitdiff_plain;h=3d652ca540f5b59788357df4adce38e81a303fc5;p=p5sagit%2Fp5-mst-13.2.git Re: bleadperl: PerlIOStdio_invalidate_fileno breaks fclose semantics Message-Id: <20030201130352.1872.12@bactrian.ni-s.u-net.com> p4raw-id: //depot/perl@18614 --- diff --git a/perlio.c b/perlio.c index a9228b4..c22af6b 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);