summaryrefslogtreecommitdiff
path: root/t/signal.t
diff options
context:
space:
mode:
Diffstat (limited to 't/signal.t')
-rw-r--r--t/signal.t34
1 files changed, 34 insertions, 0 deletions
diff --git a/t/signal.t b/t/signal.t
new file mode 100644
index 0000000..2c692d0
--- /dev/null
+++ b/t/signal.t
@@ -0,0 +1,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");