]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/SpawnPP.pm
update copyrights for 2021
[public-inbox.git] / lib / PublicInbox / SpawnPP.pm
index cd682a6b6e006aeee72c390f70f9277a4b72946d..b0ad4da5c6f7ca79467a158249587f21eb61c555 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2016-2019 all contributors <meta@public-inbox.org>
+# Copyright (C) 2016-2021 all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 
 # Pure-Perl implementation of "spawn".  This can't take advantage
@@ -36,6 +36,11 @@ sub pi_fork_exec ($$$$$$) {
                if ($cd ne '') {
                        chdir $cd or die "chdir $cd: $!";
                }
+               $SIG{$_} = 'DEFAULT' for keys %SIG;
+               my $cset = POSIX::SigSet->new();
+               $cset->addset(POSIX::SIGCHLD) or die "can't add SIGCHLD: $!";
+               sigprocmask(SIG_UNBLOCK, $cset) or
+                                       die "can't unblock SIGCHLD: $!";
                if ($ENV{MOD_PERL}) {
                        exec which('env'), '-i', @$env, @$cmd;
                        die "exec env -i ... $cmd->[0] failed: $!\n";