Message-ID: <Pine.LNX.4.44.
0207111013090.31260-100000@lapaki>
p4raw-id: //depot/perl@17492
ok(print $fh "$lines[1]");
# close it using XS
- # This works fine but causes a segmentation fault during global
- # destruction when the glob associated with this filehandle is
- # tidied up.
-# ok( T_STDIO_close( $fh ) );
- ok(close($fh)); # using perlio to close the glob works fine
+ ok( T_STDIO_close( $fh ) );
# open from perl, and check contents
open($fh, "< $testfile");
RETVAL
SysRet
-T_STDIO_close( stream )
- FILE * stream
+T_STDIO_close( f )
+ PerlIO * f
+ PREINIT:
+ FILE * stream;
CODE:
+ /* Get the FILE* */
+ stream = PerlIO_findFILE( f );
RETVAL = xsfclose( stream );
+ /* Release the FILE* from the PerlIO system so that we do
+ not close the file twice */
+ PerlIO_releaseFILE(f,stream);
OUTPUT:
RETVAL