diff options
author | Eric Wong <e@80x24.org> | 2021-10-16 01:00:58 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-10-16 01:42:52 +0000 |
commit | 7893b78fd691ef1e9b503e44174ff53278b02554 (patch) | |
tree | 2137c1210e761c156d987c94053989c905e2c5da /lib/PublicInbox/LEI.pm | |
parent | 13e60633b0a4fd31f224bf172c976e8d921ec609 (diff) | |
download | public-inbox-7893b78fd691ef1e9b503e44174ff53278b02554.tar.gz |
Relying on $lei->fail is unsustainable since there'll always be parts of our code and dependencies which can trigger die() and break the event loop.
Diffstat (limited to 'lib/PublicInbox/LEI.pm')
-rw-r--r-- | lib/PublicInbox/LEI.pm | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm index 0cdcf449..511b2c1d 100644 --- a/lib/PublicInbox/LEI.pm +++ b/lib/PublicInbox/LEI.pm @@ -556,7 +556,7 @@ sub _lei_atfork_child { # we need to explicitly close things which are on stack if ($persist) { open $self->{3}, '<', '/' or die "open(/) $!"; - fchdir($self) or die; + fchdir($self); close($_) for (grep(defined, delete @$self{qw(0 1 2 sock)})); if (my $cfg = $self->{cfg}) { delete @$cfg{qw(-lei_store -watches -lei_note_event)}; @@ -779,7 +779,7 @@ sub lazy_cb ($$$) { sub dispatch { my ($self, $cmd, @argv) = @_; - fchdir($self) or return; + fchdir($self); local %ENV = %{$self->{env}}; local $current_lei = $self; # for __WARN__ $self->{2}->autoflush(1); # keep stdout buffered until x_it|DESTROY @@ -1381,7 +1381,7 @@ sub wq_done_wait { # dwaitpid callback sub fchdir { my ($lei) = @_; my $dh = $lei->{3} // die 'BUG: lei->{3} (CWD) gone'; - chdir($dh) || $lei->fail("fchdir: $!"); + chdir($dh) || die "fchdir: $!"; } sub wq_eof { # EOF callback for main daemon |