From bcd3e39ad12d284acc337707c756f374e036aa1f Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Mon, 4 Sep 2023 10:36:02 +0000 Subject: daemon: workaround pre-EVFILT_SIGNAL signals 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. --- lib/PublicInbox/Sigfd.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/Sigfd.pm') 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) -- cgit v1.2.3-24-ge0c7