From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id A56571F4B6 for ; Mon, 8 Jul 2019 07:39:05 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 1/3] daemon: use POSIX and WNOHANG more idiomatically Date: Mon, 8 Jul 2019 07:39:03 +0000 Message-Id: <20190708073905.15757-2-e@80x24.org> In-Reply-To: <20190708073905.15757-1-e@80x24.org> References: <20190708073905.15757-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: No point in uglifying our code since we need the POSIX module in many places, anyways. --- lib/PublicInbox/Daemon.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm index 2046a7f5..6cb3a0ca 100644 --- a/lib/PublicInbox/Daemon.pm +++ b/lib/PublicInbox/Daemon.pm @@ -8,6 +8,7 @@ use warnings; use Getopt::Long qw/:config gnu_getopt no_ignore_case auto_abbrev/; use IO::Handle; use IO::Socket; +use POSIX qw(WNOHANG); use Socket qw(IPPROTO_TCP SOL_SOCKET); sub SO_ACCEPTFILTER () { 0x1000 } use Cwd qw/abs_path/; @@ -15,7 +16,6 @@ STDOUT->autoflush(1); STDERR->autoflush(1); use PublicInbox::DS qw(now); require PublicInbox::EvCleanup; -require POSIX; require PublicInbox::Listener; require PublicInbox::ParentPipe; my @CMD; @@ -437,7 +437,7 @@ sub upgrade_aborted ($) { sub reap_children () { while (1) { - my $p = waitpid(-1, &POSIX::WNOHANG) or return; + my $p = waitpid(-1, WNOHANG) or return; if (defined $reexec_pid && $p == $reexec_pid) { upgrade_aborted($p); } elsif (defined(my $id = delete $pids{$p})) { -- EW