]> Sergey Matveev's repositories - public-inbox.git/commitdiff
script/lei: waitpid for git-credential and pager
authorEric Wong <e@80x24.org>
Mon, 5 Apr 2021 08:36:57 +0000 (08:36 +0000)
committerEric Wong <e@80x24.org>
Mon, 5 Apr 2021 19:12:26 +0000 (19:12 +0000)
We need to ensure we reap things we spawn.

script/lei

index 78a7dab9b1a634e61cb45a73b5f1dc8732cd77cf..76217ab9ba575e4e580aba0a789a67f634619dce 100755 (executable)
@@ -52,7 +52,11 @@ my $exec_cmd = sub {
                @parent = ($parent);
                return; # continue $recv_cmd in background
        }
-       $do_exec->() if !scalar(@$fds); # MUA reuses all FDs
+       if (scalar(@$fds)) {
+               $pids{$pid} = undef;
+       } else {
+               $do_exec->(); # MUA reuses all FDs
+       }
 };
 
 if ($send_cmd && eval {