-# Copyright (C) 2019-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
# Licensed the same as Danga::Socket (and Perl5)
# License: GPL-1.0+ or Artistic-1.0-Perl
# <https://www.gnu.org/licenses/gpl-1.0.txt>
#
# It also implements signalfd(2) emulation via "tie".
package PublicInbox::DSKQXS;
-use strict;
-use warnings;
+use v5.12;
use parent qw(Exporter);
use Symbol qw(gensym);
use IO::KQueue;
-# Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# Used by public-inbox-watch for Maildir (and possibly MH in the future)
package PublicInbox::DirIdle;
-use strict;
+use v5.12;
use parent 'PublicInbox::DS';
use PublicInbox::Syscall qw(EPOLLIN);
use PublicInbox::In2Tie;
-# Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# for systems lacking Linux::Inotify2 or IO::KQueue, just emulates
# enough of Linux::Inotify2
package PublicInbox::FakeInotify;
-use strict;
-use v5.10.1;
+use v5.12;
use parent qw(Exporter);
use Time::HiRes qw(stat);
use PublicInbox::DS qw(add_timer);
}
package PublicInbox::FakeInotify::Watch;
-use strict;
+use v5.12;
sub cancel {
my ($self) = @_;
}
package PublicInbox::FakeInotify::Event;
-use strict;
+use v5.12;
sub fullname { ${$_[0]} }
sub IN_DELETE_SELF { 0 }
package PublicInbox::FakeInotify::GoneEvent;
-use strict;
+use v5.12;
our @ISA = qw(PublicInbox::FakeInotify::Event);
sub IN_DELETE { 1 }
sub IN_MOVED_FROM { 0 }
package PublicInbox::FakeInotify::SelfGoneEvent;
-use strict;
+use v5.12;
our @ISA = qw(PublicInbox::FakeInotify::GoneEvent);
sub IN_DELETE_SELF { 1 }
-# Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# used to ensure PublicInbox::DS can call fileno() as a function
# on Linux::Inotify2 objects
package PublicInbox::In2Tie;
-use strict;
+use v5.12;
use Symbol qw(gensym);
sub io {
# inot: Linux::Inotify2-like object
# pathmap => { inboxdir => [ ibx, watch1, watch2, watch3... ] } mapping
package PublicInbox::InboxIdle;
-use strict;
+use v5.12;
use parent qw(PublicInbox::DS);
use PublicInbox::Syscall qw(EPOLLIN);
my $IN_MODIFY = 0x02; # match Linux inotify
-# Copyright (C) 2020-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
# License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
# implements the small subset of Linux::Inotify2 functionality we use
# using IO::KQueue on *BSD systems.
package PublicInbox::KQNotify;
-use strict;
-use v5.10.1;
+use v5.12;
use IO::KQueue;
use PublicInbox::DSKQXS; # wraps IO::KQueue for fork-safe DESTROY
use PublicInbox::FakeInotify qw(fill_dirlist on_dir_change);
'PublicInbox::KQNotify::Watchdir';
} else {
open($fh, '<', $path) or return;
- $watch = bless [ $fh, $path ],
- 'PublicInbox::KQNotify::Watch';
+ $watch = bless [ $fh, $path ], 'PublicInbox::KQNotify::Watch';
}
my $ident = fileno($fh);
$self->{dskq}->{kq}->EV_SET($ident, # ident (fd)
}
package PublicInbox::KQNotify::Watch;
-use strict;
+use v5.12;
sub name { $_[0]->[1] }
sub cancel { close $_[0]->[0] or die "close: $!" }
package PublicInbox::KQNotify::Watchdir;
-use strict;
+use v5.12;
sub name { $_[0]->[1] }