diff options
author | Eric Wong <e@80x24.org> | 2023-10-01 09:54:23 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-10-01 22:41:45 +0000 |
commit | 27e5783fedcde41cd8831399cf0c089ab37bb4ee (patch) | |
tree | ec91c841115922f8f6f190d4b815edf34e237c7a /lib/PublicInbox/LEI.pm | |
parent | d3f4fcd36fda8cc56b3fa6931935b91a579d4fa0 (diff) | |
download | public-inbox-27e5783fedcde41cd8831399cf0c089ab37bb4ee.tar.gz |
The first argument passed to Perl signal handlers is a signal name (e.g. "TERM") and not an integer that can be passed to the `exit' perlop. Thus we must look up the integer value from the POSIX module.
Diffstat (limited to 'lib/PublicInbox/LEI.pm')
-rw-r--r-- | lib/PublicInbox/LEI.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index 48c5644b..1b14d5e1 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -1310,9 +1310,9 @@ sub lazy_start { local $quit = do { my (undef, $eof_p) = PublicInbox::PktOp->pair; sub { - $exit_code //= shift; + $exit_code //= eval("POSIX::SIG$_[0] + 128") if @_; eval 'PublicInbox::LeiNoteEvent::flush_task()'; - my $lis = $pil or exit($exit_code); + my $lis = $pil or exit($exit_code // 0); # closing eof_p triggers \&noop wakeup $listener = $eof_p = $pil = $path = undef; $lis->close; # DS::close |