]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/LEI.pm
on_destroy: support PID owner guard
[public-inbox.git] / lib / PublicInbox / LEI.pm
index b84e24ef953da9800823278b678c46ca38e1f6fa..4af85d49bbb83a3b9b483fbab7f4b680771d3953 100644 (file)
@@ -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: $!";