about summary refs log tree commit homepage
path: root/lib/PublicInbox/LeiToMail.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-09-22 21:13:14 +0000
committerEric Wong <e@80x24.org>2023-09-22 22:39:38 +0000
commit135f34ac52b4c6118753027c03cd8e88286aa037 (patch)
tree90cdca04e16c33d4f91dd3ac303ea8a38c5a7e5e /lib/PublicInbox/LeiToMail.pm
parentcb06b7a7f4d9d51033fa9455b59167742ebc267a (diff)
downloadpublic-inbox-135f34ac52b4c6118753027c03cd8e88286aa037.tar.gz
lei: improve ->fail internal API
Allow the exit code to be the first argument intead of the last
to match our ->child_error, as well as the BSD err(3) API.
We'll also avoid shifting user-passed exit codes so $? can be
passed as-is without losing signal information.
Diffstat (limited to 'lib/PublicInbox/LeiToMail.pm')
-rw-r--r--lib/PublicInbox/LeiToMail.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/LeiToMail.pm b/lib/PublicInbox/LeiToMail.pm
index e357ee00..7c7967c8 100644
--- a/lib/PublicInbox/LeiToMail.pm
+++ b/lib/PublicInbox/LeiToMail.pm
@@ -154,7 +154,7 @@ sub reap_compress { # awaitpid callback
         my ($pid, $lei) = @_;
         my $cmd = delete $lei->{"pid.$pid"};
         return if $? == 0;
-        $lei->fail("@$cmd failed", $? >> 8);
+        $lei->fail($?, "@$cmd failed");
 }
 
 sub _post_augment_mbox { # open a compressor process from top-level process