diff options
author | Eric Wong <e@80x24.org> | 2023-12-28 04:23:00 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-12-29 16:56:08 +0000 |
commit | cf977e706b07e80f394570a393eb2169b9b9a1a7 (patch) | |
tree | caa1a8a4cad1ec89e59658fc088a3b5054dbf58a /lib/PublicInbox/DirIdle.pm | |
parent | 84874a852c80e3d4eb96af14c017b37424cdf840 (diff) | |
download | public-inbox-cf977e706b07e80f394570a393eb2169b9b9a1a7.tar.gz |
This is a step towards improving the out-of-the-box experience in achieving notifications without XS, extra downloads, and .so loading + runtime mmap overhead. This also fixes loongarch support of all Linux syscalls due to a bad regexp :x All the reachable Linux architectures listed at <https://portal.cfarm.net/machines/list/> should be supported. At the moment, there appears to be no reachable sparc* Linux machines available to cfarm users. Fixes: b0e5093aa3572a86 (syscall: add support for riscv64, 2022-08-11)
Diffstat (limited to 'lib/PublicInbox/DirIdle.pm')
-rw-r--r-- | lib/PublicInbox/DirIdle.pm | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/lib/PublicInbox/DirIdle.pm b/lib/PublicInbox/DirIdle.pm index e6a326ab..230df166 100644 --- a/lib/PublicInbox/DirIdle.pm +++ b/lib/PublicInbox/DirIdle.pm @@ -10,12 +10,12 @@ use PublicInbox::In2Tie; my ($MAIL_IN, $MAIL_GONE, $ino_cls); if ($^O eq 'linux' && eval { require PublicInbox::Inotify; 1 }) { - $MAIL_IN = Linux::Inotify2::IN_MOVED_TO() | - Linux::Inotify2::IN_CREATE(); - $MAIL_GONE = Linux::Inotify2::IN_DELETE() | - Linux::Inotify2::IN_DELETE_SELF() | - Linux::Inotify2::IN_MOVE_SELF() | - Linux::Inotify2::IN_MOVED_FROM(); + $MAIL_IN = PublicInbox::Inotify::IN_MOVED_TO() | + PublicInbox::Inotify::IN_CREATE(); + $MAIL_GONE = PublicInbox::Inotify::IN_DELETE() | + PublicInbox::Inotify::IN_DELETE_SELF() | + PublicInbox::Inotify::IN_MOVE_SELF() | + PublicInbox::Inotify::IN_MOVED_FROM(); $ino_cls = 'PublicInbox::Inotify'; # Perl 5.22+ is needed for fileno(DIRHANDLE) support: } elsif ($^V ge v5.22 && eval { require PublicInbox::KQNotify }) { @@ -79,7 +79,7 @@ sub event_step { my $cb = $self->{cb} or return; local $PublicInbox::DS::in_loop = 0; # waitpid() synchronously (FIXME) eval { - my @events = $self->{inot}->read; # Linux::Inotify2->read + my @events = $self->{inot}->read; # Inotify3->read $cb->($_) for @events; }; warn "$self->{inot}->read err: $@\n" if $@; @@ -88,7 +88,7 @@ sub event_step { sub force_close { my ($self) = @_; my $inot = delete $self->{inot} // return; - if ($inot->can('fh')) { # Linux::Inotify2 2.3+ + if ($inot->can('fh')) { # Inotify3 or Linux::Inotify2 2.3+ $inot->fh->close or warn "CLOSE ERROR: $!"; } elsif ($inot->isa('Linux::Inotify2')) { require PublicInbox::LI2Wrap; |