From b2b1006759730507731fcd3fc3e0de68239e3b92 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sat, 27 Jun 2020 10:03:36 +0000 Subject: watch: remove Filesys::Notify::Simple dependency Since we already use inotify and EVFILT_VNODE (kqueue) in -imapd, we might as well use them directly in -watch, too. This will allow public-inbox-watch to use PublicInbox::DS for timers to watch newsgroups/mailboxes and have saner signal handling in future commits. --- lib/PublicInbox/InboxIdle.pm | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'lib/PublicInbox/InboxIdle.pm') 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; -- cgit v1.2.3-24-ge0c7