From 078ad3d512f5b07ef491adae284350f79f4ae656 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 4 Sep 2023 10:36:03 +0000 Subject: watch: ensure children can use signal handlers Blindly using the signal set inherited from the parent process is wrong, since the parent (or grandparent) could've blocked all signals. Ensure children can process signals in the event loop when sig handlers have to use standard Perl facilities. --- script/public-inbox-watch | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'script') diff --git a/script/public-inbox-watch b/script/public-inbox-watch index 2fb27343..75a9a36b 100755 --- a/script/public-inbox-watch +++ b/script/public-inbox-watch @@ -17,7 +17,7 @@ my $do_scan = 1; GetOptions('scan!' => \$do_scan, # undocumented, testing only 'help|h' => \(my $show_help)) or do { print STDERR $help; exit 1 }; if ($show_help) { print $help; exit 0 }; -my $oldset = PublicInbox::DS::block_signals(); +PublicInbox::DS::block_signals(); STDOUT->autoflush(1); STDERR->autoflush(1); local $0 = $0; # local since this script may be eval-ed @@ -55,5 +55,5 @@ if ($watch) { # --no-scan is only intended for testing atm, undocumented. PublicInbox::DS::requeue($scan) if $do_scan; - $watch->watch($sig, $oldset) while ($watch); + $watch->watch($sig) while ($watch); } -- cgit v1.2.3-24-ge0c7