summaryrefslogtreecommitdiffstats
path: root/gnu/usr.bin/perl/t/op/sigsystem.t
diff options
context:
space:
mode:
Diffstat (limited to 'gnu/usr.bin/perl/t/op/sigsystem.t')
-rw-r--r--gnu/usr.bin/perl/t/op/sigsystem.t15
1 files changed, 7 insertions, 8 deletions
diff --git a/gnu/usr.bin/perl/t/op/sigsystem.t b/gnu/usr.bin/perl/t/op/sigsystem.t
index 197ecb28732..ddfebf969b2 100644
--- a/gnu/usr.bin/perl/t/op/sigsystem.t
+++ b/gnu/usr.bin/perl/t/op/sigsystem.t
@@ -17,6 +17,13 @@ SKIP: {
require POSIX;
require Time::HiRes;
+ my @pids;
+ $SIG{CHLD} = sub {
+ while ((my $child = waitpid(-1, POSIX::WNOHANG())) > 0) {
+ note "Reaped: $child";
+ push @pids, $child;
+ }
+ };
my $pid = fork // die "Can't fork: $!";
unless ($pid) {
note("Child PID: $$");
@@ -26,14 +33,6 @@ SKIP: {
test_system('without reaper');
- my @pids;
- $SIG{CHLD} = sub {
- while ((my $child = waitpid(-1, POSIX::WNOHANG())) > 0) {
- note "Reaped: $child";
- push @pids, $child;
- }
- };
-
test_system('with reaper');
note("Waiting briefly for SIGCHLD...");