diff options
Diffstat (limited to 'lib/PublicInbox/DS.pm')
-rw-r--r-- | lib/PublicInbox/DS.pm | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm index e89dc430..97546016 100644 --- a/lib/PublicInbox/DS.pm +++ b/lib/PublicInbox/DS.pm @@ -193,10 +193,16 @@ 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); + sub block_signals { # anything in @_ stays unblocked my $newset = POSIX::SigSet->new; $newset->fillset or die "fillset: $!"; - $newset->delset($_) for @_; + for (@_, @UNBLOCKABLE) { $newset->delset($_) or die "delset($_): $!" } my $oldset = POSIX::SigSet->new; sig_setmask($newset, $oldset); $oldset; |