]> Sergey Matveev's repositories - public-inbox.git/commitdiff
dskqxs: fix loop to allow `next'
authorEric Wong <e@80x24.org>
Tue, 11 Oct 2022 00:05:54 +0000 (00:05 +0000)
committerEric Wong <e@80x24.org>
Tue, 11 Oct 2022 00:07:57 +0000 (00:07 +0000)
`do {} while(...)' loops in Perl don't support `next', actually :x
This only affects *BSD platforms with IO::KQueue installed.

Fixes: d6674af04cb74a4e "httpd|nntpd: avoid missed signal wakeups"
lib/PublicInbox/DSKQXS.pm

index eccfa56d72cb5fc8d2151a6f2f1f4b19e9251ce9..7141b1317f96d87ebae12fb4417df1e52ffd6da5 100644 (file)
@@ -71,7 +71,7 @@ sub READ { # called by sysread() for signalfd compatibility
        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:
@@ -94,7 +94,7 @@ sub READ { # called by sysread() for signalfd compatibility
                # 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