From 54929c5ed9c91eb23660a9822829d2a3170ef0e9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 11 Sep 2023 09:41:31 +0000 Subject: ds: use constants for @UNBLOCKABLE list 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(-) (limited to 'lib/PublicInbox/DS.pm') 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; -- cgit v1.2.3-24-ge0c7