diff --git a/lib/IPC/Run.pm b/lib/IPC/Run.pm index ce97c0b..e2d8f9a 100644 --- a/lib/IPC/Run.pm +++ b/lib/IPC/Run.pm @@ -1460,6 +1460,10 @@ sub _exec { # exec @_ or croak "$!: exec( " . join( ', ', @_ ) . " )"; _debug 'exec()ing ', join " ", map "'$_'", @_ if _debugging_details; + my $new = POSIX::SigSet->new(&POSIX::SIGTERM); + POSIX::sigprocmask(&POSIX::SIG_BLOCK, $new); + sleep 1; + # { ## Commented out since we don't call this on Win32. # # This works around the bug where 5.6.1 complains diff --git a/t/kill_kill.t b/t/kill_kill.t index 6c7e27f..1411975 100644 --- a/t/kill_kill.t +++ b/t/kill_kill.t @@ -38,11 +38,16 @@ SCOPE: { [ $^X, '-e', - 'sleep while 1', + ' +use POSIX; +my $new = POSIX::SigSet->new(&POSIX::SIGTERM); +POSIX::sigprocmask(&POSIX::SIG_UNBLOCK, $new); +sleep while 1 +', ] ); - my $needed = $h->kill_kill; + my $needed = $h->kill_kill;#( grace => 3 ); ok( !$needed, 'Did not need kill_kill' ); }