Advertisement
cheako

Perl closes file on me.

Oct 29th, 2015
304
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Perl 0.42 KB | None | 0 0
  1. pipe( GETPID, SENDPID );
  2. SENDPID->autoflush(1);
  3.  
  4. $^F = fileno(SENDPID)
  5.   if ( $^F < fileno(SENDPID) );
  6. push my @cpid, fork_ok(
  7.     1,
  8.     sub {
  9.         close(GETPID);
  10.         $^F = fileno(SENDPID)
  11.           if ( $^F < fileno(SENDPID) );
  12.         my $r =
  13.           system( 'lsof -np $$; echo $$ >&'
  14.               . fileno(SENDPID)
  15.               . '; exec src/ihlt >&2' );
  16.         ok( $r == 2, 'ihlt: quit' );
  17.     }
  18. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement