about summary refs log tree commit homepage
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-01-20 14:04:44 +0900
committerEric Wong <e@80x24.org>2021-01-21 03:29:17 +0000
commit19f20f44e325523cebe5665d887003a4f75cc1c0 (patch)
tree8b28b5fc094c8d86884aa3f2df90798a7a5e2d56
parent3dde6fa1268e2f86f10f26b7d427598e582aed2a (diff)
downloadpublic-inbox-19f20f44e325523cebe5665d887003a4f75cc1c0.tar.gz
waitpid() in DESTROY ends up setting $? for the exit status,
thus we must reap IPC children before calling CORE::exit.

This fixes t/lei-oneshot.t with TEST_RUN_MODE=0
-rw-r--r--lib/PublicInbox/LEI.pm5
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index f3edfe82..97ae2c41 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -249,6 +249,11 @@ sub x_it ($$) {
         if (my $sock = $self->{sock}) {
                 send($sock, "x_it $code", MSG_EOR);
         } elsif (!($code & 127)) { # oneshot, ignore signals
+                # don't want to end up using $? from child processes
+                for my $f (qw(lxs l2m)) {
+                        my $wq = delete $self->{$f} or next;
+                        $wq->DESTROY;
+                }
                 $quit->($code >> 8);
         }
 }