about summary refs log tree commit homepage
path: root/lib/PublicInbox/Syscall.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-09-11 09:41:27 +0000
committerEric Wong <e@80x24.org>2023-09-11 18:51:14 +0000
commitd98a23c63ae1da65b8521fdd6faa9e9fb5f898e9 (patch)
treec46505bddfb7990c50be65176dd280c814d5bcc1 /lib/PublicInbox/Syscall.pm
parent9231d2e7b93f2739c215c51164569347c90c646a (diff)
downloadpublic-inbox-d98a23c63ae1da65b8521fdd6faa9e9fb5f898e9.tar.gz
The awaitpid API turns out to be quite handy for managing
long-lived worker processes.  This allows us to ensure all our
uses of signalfd (and kevent emulation) are non-blocking.
Diffstat (limited to 'lib/PublicInbox/Syscall.pm')
-rw-r--r--lib/PublicInbox/Syscall.pm6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/PublicInbox/Syscall.pm b/lib/PublicInbox/Syscall.pm
index 4609b32d..14cd1720 100644
--- a/lib/PublicInbox/Syscall.pm
+++ b/lib/PublicInbox/Syscall.pm
@@ -327,15 +327,15 @@ sub epoll_wait_mod8 {
         }
 }
 
-sub signalfd ($$) {
-        my ($signos, $nonblock) = @_;
+sub signalfd ($) {
+        my ($signos) = @_;
         if ($SYS_signalfd4) {
                 my $set = POSIX::SigSet->new(@$signos);
                 syscall($SYS_signalfd4, -1, "$$set",
                         # $Config{sig_count} is NSIG, so this is NSIG/8:
                         int($Config{sig_count}/8),
                         # SFD_NONBLOCK == O_NONBLOCK for every architecture
-                        ($nonblock ? O_NONBLOCK : 0) |$SFD_CLOEXEC);
+                        O_NONBLOCK|$SFD_CLOEXEC);
         } else {
                 $! = ENOSYS;
                 undef;