about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-09-26 07:44:37 +0000
committerEric Wong <e@80x24.org>2023-09-26 21:02:41 +0000
commit01ccde5dcd089c6ae9e7571f8112723184931e09 (patch)
treef51c23f4af7365d4d712068babdd032082719dc7
parent258412f81ca477c0f86101c3dfeeab0ec19d906c (diff)
downloadpublic-inbox-01ccde5dcd089c6ae9e7571f8112723184931e09.tar.gz
waitpid with a positive PID isn't going to return anything
else unless we set ($SIG{CHLD} = 'IGNORE').
-rw-r--r--lib/PublicInbox/LeiBlob.pm5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/PublicInbox/LeiBlob.pm b/lib/PublicInbox/LeiBlob.pm
index 5fc6d902..1d8267c8 100644
--- a/lib/PublicInbox/LeiBlob.pm
+++ b/lib/PublicInbox/LeiBlob.pm
@@ -21,10 +21,9 @@ sub get_git_dir ($$) {
         } else { # implicit --cwd, quiet errors
                 open $opt->{2}, '>', '/dev/null' or die "open /dev/null: $!";
         }
-        my ($r, $pid) = popen_rd($cmd, {GIT_DIR => undef}, $opt);
+        my $r = popen_rd($cmd, {GIT_DIR => undef}, $opt);
         chomp(my $gd = do { local $/; <$r> });
-        waitpid($pid, 0) == $pid or die "BUG: waitpid @$cmd ($!)";
-        $? == 0 ? $gd : undef;
+        close($r) ? $gd : undef;
 }
 
 sub solver_user_cb { # called by solver when done