From 19f20f44e325523cebe5665d887003a4f75cc1c0 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 20 Jan 2021 14:04:44 +0900 Subject: lei: exit code in oneshot mode 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 --- lib/PublicInbox/LEI.pm | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'lib') 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); } } -- cgit v1.2.3-24-ge0c7