about summary refs log tree commit homepage
path: root/lib/PublicInbox/Sigfd.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-09-04 10:36:02 +0000
committerEric Wong <e@80x24.org>2023-09-05 03:01:38 +0000
commitbcd3e39ad12d284acc337707c756f374e036aa1f (patch)
tree5b85381fc405e2e963212fdb18d6958ce21d15c8 /lib/PublicInbox/Sigfd.pm
parent56706d5d25de794539a974221d553f20f1e619ea (diff)
downloadpublic-inbox-bcd3e39ad12d284acc337707c756f374e036aa1f.tar.gz
FreeBSD and OpenBSD kqueue EVFILT_SIGNAL isn't able to handle
blocked signals which were sent before the filter is created.
This behavior differs from Linux signalfd, which can process
blocked signals that were sent before the signalfd existed.
Diffstat (limited to 'lib/PublicInbox/Sigfd.pm')
-rw-r--r--lib/PublicInbox/Sigfd.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/PublicInbox/Sigfd.pm b/lib/PublicInbox/Sigfd.pm
index 3c1d3811..5656baeb 100644
--- a/lib/PublicInbox/Sigfd.pm
+++ b/lib/PublicInbox/Sigfd.pm
@@ -31,8 +31,9 @@ sub new {
                 $self->SUPER::new($io, EPOLLIN | EPOLLET);
         } else { # master main loop
                 $self->{sock} = $io;
-                $self;
         }
+        $self->{is_kq} = 1 if tied(*$io);
+        $self;
 }
 
 # PublicInbox::Daemon in master main loop (blocking)