]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
watch: set %SIG for non-signalfd/kqueue
authorEric Wong <e@80x24.org>
Fri, 8 Sep 2023 10:51:14 +0000 (10:51 +0000)
committerEric Wong <e@80x24.org>
Fri, 8 Sep 2023 20:43:17 +0000 (20:43 +0000)
We need to ensure there isn't a window where we lose $SIG{CHLD}
handling.  This is the second part in getting t/imapd.t to pass
the reload-after-setting-imap.pollInterval test

That said, I'm not entirely happy with the way -watch jumps
in and out of the event loop.  It's historical baggage from
the pre-event_loop days.

script/public-inbox-watch

index 75a9a36bf99a2cde6102c616c188bb636b6b4046..870cd31babc6fdc120eb0a4ad9a3412daa7992a5 100755 (executable)
@@ -52,6 +52,7 @@ if ($watch) {
                CHLD => \&PublicInbox::DS::enqueue_reap,
        };
        $sig->{QUIT} = $sig->{TERM} = $sig->{INT} = $quit;
+       local @SIG{keys %$sig} = values(%$sig); # for non-signalfd/kqueue
 
        # --no-scan is only intended for testing atm, undocumented.
        PublicInbox::DS::requeue($scan) if $do_scan;