about summary refs log tree commit homepage
path: root/lib/PublicInbox/LEI.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-12-31 13:51:54 +0000
committerEric Wong <e@80x24.org>2021-01-01 05:00:40 +0000
commit0d6777e0389fe2db3edce41d675320746433f5b7 (patch)
treebd74fac722a93a2432e472e9b5c9797a41737f5f /lib/PublicInbox/LEI.pm
parent3823705b72199c61e8ed96aabd34d21a63fe153c (diff)
downloadpublic-inbox-0d6777e0389fe2db3edce41d675320746433f5b7.tar.gz
Since we'll be forking for Xapian indexing and maybe
other places, having a simple guard in place to ensure
OnDestroy doesn't unexpectedly unlink files or similar
is a safer option.
Diffstat (limited to 'lib/PublicInbox/LEI.pm')
-rw-r--r--lib/PublicInbox/LEI.pm5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/PublicInbox/LEI.pm b/lib/PublicInbox/LEI.pm
index b84e24ef..4af85d49 100644
--- a/lib/PublicInbox/LEI.pm
+++ b/lib/PublicInbox/LEI.pm
@@ -745,9 +745,8 @@ sub lazy_start {
         # reading the <$daemon> pipe.
         openlog($path, 'pid', 'user');
         local $SIG{__WARN__} = sub { syslog('warning', "@_") };
-        my $owner_pid = $$;
-        my $on_destroy = PublicInbox::OnDestroy->new(sub {
-                syslog('crit', "$@") if $@ && $$ == $owner_pid;
+        my $on_destroy = PublicInbox::OnDestroy->new($$, sub {
+                syslog('crit', "$@") if $@;
         });
         open STDERR, '>&STDIN' or die "redirect stderr failed: $!";
         open STDOUT, '>&STDIN' or die "redirect stdout failed: $!";