From 84050272ef72aadbc2fc6abf106a27ff1bb3ddc7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Tue, 17 Jan 2023 07:19:07 +0000 Subject: eofpipe: drop {arg} support for now The only user of EOFpipe has no args, so avoid wasting a hash slot on it. If we need it again in the future, EOFpipe will allow an array of args, instead. --- lib/PublicInbox/Daemon.pm | 2 +- lib/PublicInbox/EOFpipe.pm | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm index ee746f05..17e799ca 100644 --- a/lib/PublicInbox/Daemon.pm +++ b/lib/PublicInbox/Daemon.pm @@ -693,7 +693,7 @@ sub daemon_loop ($) { if ($worker_processes > 0) { $refresh->(); # preload by default my $fh = master_loop(); # returns if in child process - PublicInbox::EOFpipe->new($fh, \&worker_quit, undef); + PublicInbox::EOFpipe->new($fh, \&worker_quit); } else { reopen_logs(); $set_user->() if $set_user; diff --git a/lib/PublicInbox/EOFpipe.pm b/lib/PublicInbox/EOFpipe.pm index e537e2aa..628e9366 100644 --- a/lib/PublicInbox/EOFpipe.pm +++ b/lib/PublicInbox/EOFpipe.pm @@ -1,14 +1,14 @@ -# Copyright (C) 2020-2021 all contributors +# Copyright (C) all contributors # License: AGPL-3.0+ package PublicInbox::EOFpipe; -use strict; +use v5.12; use parent qw(PublicInbox::DS); use PublicInbox::Syscall qw(EPOLLIN EPOLLONESHOT); sub new { - my (undef, $rd, $cb, $arg) = @_; - my $self = bless { cb => $cb, arg => $arg }, __PACKAGE__; + my (undef, $rd, $cb) = @_; + my $self = bless { cb => $cb }, __PACKAGE__; # 1031: F_SETPIPE_SZ, 4096: page size fcntl($rd, 1031, 4096) if $^O eq 'linux'; $self->SUPER::new($rd, EPOLLIN|EPOLLONESHOT); @@ -17,7 +17,7 @@ sub new { sub event_step { my ($self) = @_; if ($self->do_read(my $buf, 1) == 0) { # auto-closed - $self->{cb}->($self->{arg}); + $self->{cb}->(); } } -- cgit v1.2.3-24-ge0c7