-# Copyright (C) 2019-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
# Licensed the same as Danga::Socket (and Perl5)
# License: GPL-1.0+ or Artistic-1.0-Perl
# <https://www.gnu.org/licenses/gpl-1.0.txt>
#
# It also implements signalfd(2) emulation via "tie".
package PublicInbox::DSKQXS;
-use strict;
-use warnings;
+use v5.12;
use parent qw(Exporter);
use Symbol qw(gensym);
use IO::KQueue;
my $nr = $len / 128;
my $r = 0;
$_[1] = '';
- do {
+ while (1) {
while ($nr--) {
my $signo = shift(@$sigbuf) or last;
# caller only cares about signalfd_siginfo.ssi_signo:
# field shows coalesced signals, and maybe we'll use it
# in the future...
@$sigbuf = map { $_->[0] } @events;
- } while (1);
+ }
}
# for fileno() calls in PublicInbox::DS
$kq->EV_SET($fd, EVFILT_READ, kq_flag(EPOLLIN, $ev));
eval { $kq->EV_SET($fd, EVFILT_WRITE, kq_flag(EPOLLOUT, $ev)) };
} elsif ($op == EPOLL_CTL_DEL) {
+ use Carp ();
+ $kq // Carp::confess("nokq $fd");
$kq->EV_SET($fd, EVFILT_READ, EV_DISABLE);
eval { $kq->EV_SET($fd, EVFILT_WRITE, EV_DISABLE) };
} else { # EPOLL_CTL_ADD