about summary refs log tree commit homepage
path: root/lib/PublicInbox/Daemon.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2020-12-20 06:30:15 +0000
committerEric Wong <e@80x24.org>2020-12-20 20:39:14 +0000
commite77241850763dea9995381f3c0c7b354aa791cc0 (patch)
tree3b46b4f3e4c33718f3587293cccfd3e7a7342a00 /lib/PublicInbox/Daemon.pm
parentdf708a4f7c4d62ef685ccf9868c78ff2709c1f40 (diff)
downloadpublic-inbox-e77241850763dea9995381f3c0c7b354aa791cc0.tar.gz
The `kill' perl op takes multiple PIDs, so there's no need to
iterate through the %pids hash.
Diffstat (limited to 'lib/PublicInbox/Daemon.pm')
-rw-r--r--lib/PublicInbox/Daemon.pm7
1 files changed, 2 insertions, 5 deletions
diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm
index eeac3bd2..1762be0b 100644
--- a/lib/PublicInbox/Daemon.pm
+++ b/lib/PublicInbox/Daemon.pm
@@ -419,11 +419,8 @@ sub upgrade { # $_[0] = signal name or number (unused)
 }
 
 sub kill_workers ($) {
-        my ($s) = @_;
-
-        while (my ($pid, $id) = each %pids) {
-                kill $s, $pid;
-        }
+        my ($sig) = @_;
+        kill $sig, keys(%pids);
 }
 
 sub upgrade_aborted ($) {