* [PATCH 2/7] lei: exit code in oneshot mode
2021-01-20 5:04 4% ` [PATCH 0/7] lei: fixes piled higher and deeper Eric Wong
@ 2021-01-20 5:04 7% ` Eric Wong
1 sibling, 0 replies; 2+ results
From: Eric Wong @ 2021-01-20 5:04 UTC (permalink / raw)
To: meta
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(+)
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);
}
}
^ permalink raw reply related [relevance 7%]
* [PATCH 0/7] lei: fixes piled higher and deeper
@ 2021-01-20 5:04 4% ` Eric Wong
2021-01-20 5:04 7% ` [PATCH 2/7] lei: exit code in oneshot mode Eric Wong
1 sibling, 0 replies; 2+ results
From: Eric Wong @ 2021-01-20 5:04 UTC (permalink / raw)
To: meta
1/7 was necessary on my FreeBSD 11.x VM
2/7 fixes TEST_RUN_MODE=0
3/7 fixes a long-standing (well, several weeks) annoyance
4/7 depended on 3/7, sorta
5/7 should've been done ages ago
6/7 oops :x
7/7 belts and suspenders
Eric Wong (7):
lei: allow more mbox inode types
lei: exit code in oneshot mode
overidx: eidx_prep: fix leftover dbh reference
lei q: cleanup store initialization
lei: dump and clear errors.log in daemon mode
lei_xsearch: keep l2m->{-wq_s1} while preparing query
lei_to_mail: call PublicInbox::IPC::DESTROY
lib/PublicInbox/LEI.pm | 32 +++++++++++++++++++++++++++-----
lib/PublicInbox/LeiOverview.pm | 6 ++----
lib/PublicInbox/LeiQuery.pm | 18 ++++++++----------
lib/PublicInbox/LeiToMail.pm | 5 +++--
lib/PublicInbox/LeiXSearch.pm | 4 ++--
lib/PublicInbox/OverIdx.pm | 8 +++-----
t/lei.t | 8 +++++++-
7 files changed, 52 insertions(+), 29 deletions(-)
^ permalink raw reply [relevance 4%]
Results 1-2 of 2 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2021-01-19 9:34 [PATCH 0/9] lei bugfixes and error handling Eric Wong
2021-01-20 5:04 4% ` [PATCH 0/7] lei: fixes piled higher and deeper Eric Wong
2021-01-20 5:04 7% ` [PATCH 2/7] lei: exit code in oneshot mode Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/public-inbox.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).