develooper Front page | perl.perl5.porters | Postings from February 2003

Re: bleadperl: PerlIOStdio_invalidate_fileno breaks fclose semantics

Thread Previous | Thread Next
From:
Nick Ing-Simmons
Date:
February 1, 2003 05:04
Subject:
Re: bleadperl: PerlIOStdio_invalidate_fileno breaks fclose semantics
Message ID:
20030201130352.1872.12@bactrian.ni-s.u-net.com
Michael Schroeder <Michael.Schroeder@informatik.uni-erlangen.de> writes:
>Hi porters,
>
>the fix of the socket memory hole doesn't take into account that
>fclose() flushes the stdio stream. This flushing doesn't work anymore
>if fileno gets invalidated. As a result most web services will cease
>to work.

The attached patch seems to fix that.

>
>Test program:
>
>open(T, ">/tmp/test") || die;
>open(D, ">&=".fileno(T)) || die;
>print D 'ok';
>close D || die;
>close T || die;
>open(T, "</tmp/test") || die;
>my $r = <T>;
>close T;
>$r ||= 'fail';
>print "$r\n";
>
>Cheers,
>  Michael.
-- 
Nick Ing-Simmons
http://www.ni-s.u-net.com/


Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About