about summary refs log tree commit homepage
path: root/lib/PublicInbox
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-10-26 10:35:57 +0000
committerEric Wong <e@80x24.org>2021-10-26 17:43:58 +0000
commit2251a10158054d89868ff73784ce7af6e28949fa (patch)
treeb37eca982806c153a3cff015f52fed5cb9834c77 /lib/PublicInbox
parentb35c6389859f13f4f216179dac40a481c3fd7e09 (diff)
downloadpublic-inbox-2251a10158054d89868ff73784ce7af6e28949fa.tar.gz
It's possible for ->event_step to fire twice due to ->requeue
with EPOLLET (but not EPOLLONESHOT).  So account for that and
avoid causing event loop errors as a result.
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r--lib/PublicInbox/InputPipe.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/InputPipe.pm b/lib/PublicInbox/InputPipe.pm
index 00813a07..e1e26e20 100644
--- a/lib/PublicInbox/InputPipe.pm
+++ b/lib/PublicInbox/InputPipe.pm
@@ -18,7 +18,7 @@ sub consume {
 
 sub event_step {
         my ($self) = @_;
-        my $r = sysread($self->{sock}, my $rbuf, 65536);
+        my $r = sysread($self->{sock} // return, my $rbuf, 65536);
         if ($r) {
                 $self->{cb}->(@{$self->{args} // []}, $rbuf);
                 return $self->requeue; # may be regular file or pipe