]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
lei: reuse PublicInbox::Config::noop
authorEric Wong <e@80x24.org>
Wed, 4 Oct 2023 03:49:22 +0000 (03:49 +0000)
committerEric Wong <e@80x24.org>
Wed, 4 Oct 2023 17:46:38 +0000 (17:46 +0000)
No need to define our own empty `noop' sub when PublicInbox::Config
already has one and is loaded anyways.

lib/PublicInbox/LEI.pm

index fba4edf368143dfee259952910bae065f47c6de7..c9ad46e2bc412e47b1529eca37d0e096d4b9aafa 100644 (file)
@@ -1217,8 +1217,6 @@ sub event_step_init {
        };
 }
 
-sub noop {}
-
 sub oldset { $oldset }
 
 sub dump_and_clear_log {
@@ -1364,15 +1362,9 @@ sub lazy_start {
                        $lis->close; # DS::close
                };
        };
-       my $sig = {
-               CHLD => \&PublicInbox::DS::enqueue_reap,
-               QUIT => $quit,
-               INT => $quit,
-               TERM => $quit,
-               HUP => \&noop,
-               USR1 => \&noop,
-               USR2 => \&noop,
-       };
+       my $sig = { CHLD => \&PublicInbox::DS::enqueue_reap };
+       $sig->{$_} = $quit for qw(QUIT INT TERM);
+       $sig->{$_} = \&PublicInbox::Config::noop for qw(HUP USR1 USR2);
        # for EVFILT_SIGNAL and signalfd behavioral difference:
        my @kq_ign = eval { require PublicInbox::DSKQXS } ? keys(%$sig) : ();