From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 2AB831F5AE for ; Thu, 6 May 2021 17:09:24 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] t/sigfd: use PublicInbox::DS::block_signals Date: Thu, 6 May 2021 17:09:23 +0000 Message-Id: <20210506170923.59604-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: We already use PublicInbox::DS in this test and I've always found the terminology of sig* APIs confusing :x --- t/sigfd.t | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/t/sigfd.t b/t/sigfd.t index 3a383d79..bb854147 100644 --- a/t/sigfd.t +++ b/t/sigfd.t @@ -6,15 +6,14 @@ use POSIX qw(:signal_h); use Errno qw(ENOSYS); use PublicInbox::Syscall qw(SFD_NONBLOCK); require_ok 'PublicInbox::Sigfd'; +use PublicInbox::DS; SKIP: { if ($^O ne 'linux' && !eval { require IO::KQueue }) { skip 'signalfd requires Linux or IO::KQueue to emulate', 10; } - my $new = POSIX::SigSet->new; - $new->fillset or die "sigfillset: $!"; - my $old = POSIX::SigSet->new; - sigprocmask(SIG_SETMASK, $new, $old) or die "sigprocmask $!"; + + my $old = PublicInbox::DS::block_signals(); my $hit = {}; my $sig = {}; local $SIG{HUP} = sub { $hit->{HUP}->{normal}++ }; @@ -25,7 +24,6 @@ SKIP: { } my $sigfd = PublicInbox::Sigfd->new($sig, 0); if ($sigfd) { - require PublicInbox::DS; ok($sigfd, 'Sigfd->new works'); kill('HUP', $$) or die "kill $!"; kill('INT', $$) or die "kill $!";