about summary refs log tree commit homepage
path: root/lib/PublicInbox/InboxIdle.pm
diff options
context:
space:
mode:
Diffstat (limited to 'lib/PublicInbox/InboxIdle.pm')
-rw-r--r--lib/PublicInbox/InboxIdle.pm11
1 files changed, 2 insertions, 9 deletions
diff --git a/lib/PublicInbox/InboxIdle.pm b/lib/PublicInbox/InboxIdle.pm
index 97e9d532..ba8200ae 100644
--- a/lib/PublicInbox/InboxIdle.pm
+++ b/lib/PublicInbox/InboxIdle.pm
@@ -6,7 +6,6 @@ use strict;
 use base qw(PublicInbox::DS);
 use fields qw(pi_config inot pathmap);
 use Cwd qw(abs_path);
-use Symbol qw(gensym);
 use PublicInbox::Syscall qw(EPOLLIN EPOLLET);
 my $IN_MODIFY = 0x02; # match Linux inotify
 my $ino_cls;
@@ -55,14 +54,8 @@ sub new {
         my $inot;
         if ($ino_cls) {
                 $inot = $ino_cls->new or die "E: $ino_cls->new: $!";
-                my $sock = gensym;
-                tie *$sock, 'PublicInbox::In2Tie', $inot;
-                $inot->blocking(0);
-                if ($inot->can('on_overflow')) {
-                         # broadcasts everything on overflow
-                        $inot->on_overflow(undef);
-                }
-                $self->SUPER::new($sock, EPOLLIN | EPOLLET);
+                my $io = PublicInbox::In2Tie::io($inot);
+                $self->SUPER::new($io, EPOLLIN | EPOLLET);
         } else {
                 require PublicInbox::FakeInotify;
                 $inot = PublicInbox::FakeInotify->new;