From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 86A851F569 for ; Mon, 11 Sep 2023 09:41:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1694425298; bh=bclp/GuD1Lqn71NcFGIsrpKjeHkQstaD+fX0tA+UJTA=; h=From:To:Subject:Date:In-Reply-To:References:From; b=WdUmRZrGJkZ1PUWTTesRZJgOCS+bQL28oPAMKdjQ2SWtyz5ORsL/OC2uPtICOrHWC VmMlqv+YyAgVACfA3K1WWvpjQij1wQrg12ne0mWW1GcOgjYhpSQYoalkJuicaWAz2E RDtcMCGQeY+0RNCP4FC0clpuMdbgmxdonzq5tM8s= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 6/7] ds: use constants for @UNBLOCKABLE list Date: Mon, 11 Sep 2023 09:41:31 +0000 Message-ID: <20230911094132.75792-7-e@80x24.org> In-Reply-To: <20230911094132.75792-1-e@80x24.org> References: <20230911094132.75792-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: There's no need for for a complicated map {} block here. All these unblockable signals are POSIX since 2001 at the latest, so there's no reason any platform would lack them. --- lib/PublicInbox/DS.pm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm index f2b14799..b3edc094 100644 --- a/lib/PublicInbox/DS.pm +++ b/lib/PublicInbox/DS.pm @@ -186,11 +186,9 @@ sub RunTimers { sub sig_setmask { sigprocmask(SIG_SETMASK, @_) or die "sigprocmask: $!" } -our @UNBLOCKABLE = map { # ensure we detect bugs, HW problems and user rlimits - my $cb = POSIX->can("SIG$_"); - my $num = $cb ? $cb->() : undef; - $num ? ($num) : (); -} qw(ABRT BUS FPE ILL SEGV XCPU XFSZ); +# ensure we detect bugs, HW problems and user rlimits +our @UNBLOCKABLE = (POSIX::SIGABRT, POSIX::SIGBUS, POSIX::SIGFPE, + POSIX::SIGILL, POSIX::SIGSEGV, POSIX::SIGXCPU, POSIX::SIGXFSZ); sub block_signals { # anything in @_ stays unblocked my $newset = POSIX::SigSet->new;