]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
lei: use -signal numbers for old Perl
authorEric Wong <e@80x24.org>
Wed, 15 Nov 2023 01:04:56 +0000 (01:04 +0000)
committerEric Wong <e@80x24.org>
Wed, 15 Nov 2023 04:25:00 +0000 (04:25 +0000)
Unlike modern Perls, Perl 5.16.3 on CentOS doesn't accept
negative string signals like "-TERM" .

This only became a problem since commit b231d91f42d7
(treewide: enable warnings in all exec-ed processes)
made our code stricter by enabling more warnings.
In both cases, the kill is probably unnecessary and safe
to remove since we can rely on closing sockets to drop
processes.

lib/PublicInbox/LEI.pm
lib/PublicInbox/LeiXSearch.pm

index 77acb5a15bd6c6aa8bc4757192b9453e19655b20..69065ce769424dca91b8008ab4fb7ba15b939936 100644 (file)
@@ -474,7 +474,7 @@ my @WQ_KEYS = qw(lxs l2m ikw pmd wq1 lne v2w); # internal workers
 sub _drop_wq {
        my ($self) = @_;
        for my $wq (grep(defined, delete(@$self{@WQ_KEYS}))) {
-               $wq->wq_kill('-TERM');
+               $wq->wq_kill(-POSIX::SIGTERM());
                $wq->DESTROY;
        }
 }
index b09c246261c88838be7803789b7823cdfaebdffd..e85fd3c4a3b97705baee193458e09b1ac6268ad4 100644 (file)
@@ -437,7 +437,7 @@ sub do_post_augment {
        my $err = $@;
        if ($err) {
                if (my $lxs = delete $lei->{lxs}) {
-                       $lxs->wq_kill('-TERM');
+                       $lxs->wq_kill(-POSIX::SIGTERM());
                        $lxs->wq_close;
                }
                $lei->fail("$err");