This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
As reported in bug #46207, change 30633 to PerlIO_exportFILE() and
authorNicholas Clark <nick@ccl4.org>
Mon, 5 Nov 2007 13:58:52 +0000 (13:58 +0000)
committerNicholas Clark <nick@ccl4.org>
Mon, 5 Nov 2007 13:58:52 +0000 (13:58 +0000)
commitbbbc33d002fb16005d670814239b18d82b3e6229
tree1e452e6c718b3ac5e3ae133f9485a895c3c22fa3
parenta396bf53e008922a27c700e1af53f555c39457a7
As reported in bug #46207, change 30633 to PerlIO_exportFILE() and
PerlIO_releaseFILE() to manage the reference counts of fds correctly
has the side effect of making some XS modules "leak" descriptors.
This is because the typemap calls PerlIO_findFILE(), which sometimes
(but not always) calls PerlIO_exportFILE(). To be consistent,
PerlIO_fildFILE() needs to either always give you a reference, or
always not give you a reference. It seems better to do the latter as
the call to PerlIO_exportFILE() is only an implementation detail, so
arrange for it to immediately free up the reference that
PerlIO_exportFILE() created.

p4raw-id: //depot/perl@32224
perlio.c