From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.2 required=3.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=ham autolearn_force=no version=3.4.6 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 9AE2C1FA33 for ; Tue, 17 Jan 2023 07:19:12 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1673939952; bh=9CCxbFgaM/aVuBTyMeMsbVdOfWJXrw7wc5Qi3YVtwdI=; h=From:To:Subject:Date:In-Reply-To:References:From; b=49g4soVxdyAj5f1EpgtA3oQDuvsVAtoNuhiuZ4gMf9D+SsY1ivcuUayskHaiAFbFp 9qpL1ZNyJxOhdl129ukhczOe+jn9e/802YCDsWAeIHQlc8iGFhscRAcSAF2qQqUceA fOxuXc8gVYWfqaJrirKZo/3ghkUzK3MQh4IZMrZo= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 08/12] eofpipe: drop {arg} support for now Date: Tue, 17 Jan 2023 07:19:07 +0000 Message-Id: <20230117071911.1577890-9-e@80x24.org> In-Reply-To: <20230117071911.1577890-1-e@80x24.org> References: <20230117071911.1577890-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: 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}->(); } }