about summary refs log tree commit homepage
path: root/lib/PublicInbox/DS.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-01-03 00:05:06 +0000
committerEric Wong <e@80x24.org>2023-01-03 00:20:45 +0000
commit48af4772698dc3a9bcca06b5397ca13920a31d16 (patch)
tree32cf9be3a63dcac76eae9c206613ebbd69c29934 /lib/PublicInbox/DS.pm
parent324098fecf1126233578cc2f6290b4c8fdd9207b (diff)
downloadpublic-inbox-48af4772698dc3a9bcca06b5397ca13920a31d16.tar.gz
FD_CLOEXEC is the only currently defined FD flag, and has been
the case for decades at this point.  I highly doubt any default
FD flag will ever be forced on us by the kernel, init system, or
Perl.  So save ourselves a syscall and just call F_SETFD with
the assumption FD_CLOEXEC is the only FD flag that we'd ever
care for.
Diffstat (limited to 'lib/PublicInbox/DS.pm')
-rw-r--r--lib/PublicInbox/DS.pm3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/PublicInbox/DS.pm b/lib/PublicInbox/DS.pm
index a6c43b22..e4629e97 100644
--- a/lib/PublicInbox/DS.pm
+++ b/lib/PublicInbox/DS.pm
@@ -130,8 +130,7 @@ sub _InitPoller () {
                 my $fd = epoll_create();
                 die "epoll_create: $!" if $fd < 0;
                 open($ep_io, '+<&=', $fd) or return;
-                my $fl = fcntl($ep_io, F_GETFD, 0);
-                fcntl($ep_io, F_SETFD, $fl | FD_CLOEXEC);
+                fcntl($ep_io, F_SETFD, FD_CLOEXEC);
                 $fd;
         } else {
                 my $cls;