]> Sergey Matveev's repositories - public-inbox.git/commitdiff
switch inotify/kevent stuff to v5.12
authorEric Wong <e@80x24.org>
Mon, 28 Nov 2022 05:31:08 +0000 (05:31 +0000)
committerEric Wong <e@80x24.org>
Mon, 28 Nov 2022 23:38:53 +0000 (23:38 +0000)
Another tiny step towards an eventual startup time improvements
by avoiding strict.pm

lib/PublicInbox/DSKQXS.pm
lib/PublicInbox/DirIdle.pm
lib/PublicInbox/FakeInotify.pm
lib/PublicInbox/In2Tie.pm
lib/PublicInbox/InboxIdle.pm
lib/PublicInbox/KQNotify.pm

index 4114a6af2f55f5374836ea8a948fc3cb0efdbb51..7bd7773e7225ae639c55e7d2f0811bc33c6a1dba 100644 (file)
@@ -1,4 +1,4 @@
-# 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>
@@ -11,8 +11,7 @@
 #
 # 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;
index 9206da9cb710186462ffefd10cb4af0764f7e615..55c3982f707c0f9328f4adde1e9cb90eed526126 100644 (file)
@@ -1,9 +1,9 @@
-# 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;
index 6d2696019d8324fc3676d4e49efb783e10efc15a..45b80f505557a95ed0cd157b36667477bee3fdc9 100644 (file)
@@ -1,11 +1,10 @@
-# 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);
@@ -119,7 +118,7 @@ sub poll_once {
 }
 
 package PublicInbox::FakeInotify::Watch;
-use strict;
+use v5.12;
 
 sub cancel {
        my ($self) = @_;
@@ -132,7 +131,7 @@ sub name {
 }
 
 package PublicInbox::FakeInotify::Event;
-use strict;
+use v5.12;
 
 sub fullname { ${$_[0]} }
 
@@ -141,14 +140,14 @@ sub IN_MOVED_FROM { 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 }
index ffe26a44ab3d9e38d46447fd69543e0a9d4e5c8d..3689432b2d318d36710bd4b3c913f7ebe4c0e988 100644 (file)
@@ -1,10 +1,10 @@
-# 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 {
index 005e263612d409c7a794bcc2eed1e08a47ee793e..f0d8a972ed03226074bba2317180a8e9dcf6ffa5 100644 (file)
@@ -5,7 +5,7 @@
 # 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
index 7efb8b604c99e326d02c38c3876355aa23018a35..381711fae8f400bf11b3f0bb3316c04d66207336 100644 (file)
@@ -1,11 +1,10 @@
-# 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);
@@ -29,8 +28,7 @@ sub watch {
                        '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)
@@ -100,14 +98,14 @@ sub read {
 }
 
 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] }