summaryrefslogtreecommitdiff
path: root/t/signal.t
blob: 2c692d0d840afefe98d91a27d8144f58d2476203 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/usr/local/bin/perl -w

use strict ;
use File::Slurp qw(read_file);

use Carp ;
use Test::More ;

BEGIN { 
	if( $^O =~ '32' ) {
		plan skip_all => 'skip signal test on windows';
		exit ;
	}

	plan tests => 1 ;
}

$SIG{CHLD} = sub {};

pipe(IN, OUT);

print "forking\n";
if (!fork) {
   sleep 1;
   exit;
} 
if (!fork) {
   sleep 2;
   print OUT "success";
   exit;
}
close OUT;
my $data = read_file(\*IN);
is ($data, "success", "handle EINTR failed");