File tree Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Expand file tree Collapse file tree 2 files changed +13
-7
lines changed Original file line number Diff line number Diff line change @@ -613,17 +613,23 @@ subtest 'execute exeption handling' => sub {
613613};
614614
615615subtest ' SIG_CHLD handler in spawned process' => sub {
616- my $simple_rwp = " $FindBin::Bin /data/simple_rwp.pl" ;
616+ my $simple_rwp = " $FindBin::Bin /data/simple_rwp.pl" ;
617617 my $sigchld_handler = " $FindBin::Bin /data/sigchld_handler.pl" ;
618618
619619 # use `perl <script>` here, as Github ci action place the used perl executable
620620 # somewhere like /opt/hostedtoolcache/perl/<version>/<arch>/bin/perl so
621621 # /usr/bin/perl wouldn't have all needed dependencies
622- is( process(execute => ' perl' )-> args([$simple_rwp ])-> start()-> wait_stop()-> exit_status(), 0, ' simple_rwp.pl exit with 0' );
622+ is(
623+ process(execute => ' perl' )-> args([$simple_rwp ])-> start()-> wait_stop()
624+ -> exit_status(),
625+ 0,
626+ ' simple_rwp.pl exit with 0'
627+ );
623628
624629 my $p = process(execute => $sigchld_handler );
625- is( $p -> start()-> wait_stop()-> exit_status(), 0, ' sigchld_handler.pl exit with 0' );
626- like( $p -> read_all_stdout, qr / SIG_CHLD/ , " SIG_CHLD handler was executed" );
630+ is($p -> start()-> wait_stop()-> exit_status(),
631+ 0, ' sigchld_handler.pl exit with 0' );
632+ like($p -> read_all_stdout, qr / SIG_CHLD/ , " SIG_CHLD handler was executed" );
627633};
628634
629635done_testing;
Original file line number Diff line number Diff line change 55
66my $collected_pid = -1;
77$SIG {CHLD } = sub {
8- $collected_pid = waitpid (-1, 0);
9- print " SIG_CHLD $collected_pid exit:" . ( $? >> 8) . " \n " ;
8+ $collected_pid = waitpid (-1, 0);
9+ print " SIG_CHLD $collected_pid exit:" . ($? >> 8) . " \n " ;
1010};
1111
1212my $pid = fork ();
1515 exit 0;
1616}
1717print " Forked child is $pid \n " ;
18- sleep 0.1 while ($collected_pid != $pid );
18+ sleep 0.1 while ($collected_pid != $pid );
1919print " Exit graceful\n " ;
2020exit 0;
You can’t perform that action at this time.
0 commit comments