From 27739bcba4a311b3d06eadce75294fe73646570b Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 5 Mar 2016 06:00:59 +0000 Subject: daemon: simplify parent death handling No need to create a new sub which kill ourselves $$ when we can invoke worker_quit directly. --- lib/PublicInbox/Daemon.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib') diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm index 30411e13..8a0af8de 100644 --- a/lib/PublicInbox/Daemon.pm +++ b/lib/PublicInbox/Daemon.pm @@ -391,7 +391,7 @@ sub daemon_loop ($$) { $refresh->(); # preload by default $parent_pipe = master_loop(); # returns if in child process my $fd = fileno($parent_pipe); - Danga::Socket->AddOtherFds($fd => sub { kill('TERM', $$) } ); + Danga::Socket->AddOtherFds($fd => *worker_quit); } else { reopen_logs(); $set_user->() if $set_user; -- cgit v1.2.3-24-ge0c7