From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) 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.0 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 0E6B31FAEA for ; Thu, 22 Mar 2018 09:40:17 +0000 (UTC) From: "Eric Wong (Contractor, The Linux Foundation)" To: meta@public-inbox.org Subject: [PATCH 07/13] fix syntax warnings Date: Thu, 22 Mar 2018 09:40:09 +0000 Message-Id: <20180322094015.14422-8-e@80x24.org> In-Reply-To: <20180322094015.14422-1-e@80x24.org> References: <20180322094015.14422-1-e@80x24.org> List-Id: I keep forgetting to run "make syntax" --- lib/PublicInbox/Daemon.pm | 2 +- lib/PublicInbox/EvCleanup.pm | 4 +++- lib/PublicInbox/Inbox.pm | 2 +- lib/PublicInbox/SearchMsg.pm | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/lib/PublicInbox/Daemon.pm b/lib/PublicInbox/Daemon.pm index 9d27d2b..4629aad 100644 --- a/lib/PublicInbox/Daemon.pm +++ b/lib/PublicInbox/Daemon.pm @@ -460,7 +460,7 @@ sub daemon_loop ($$) { @listeners = map { PublicInbox::Listener->new($_, $post_accept) } @listeners; - $PublicInbox::EvCleanup::ENABLED = 1; + PublicInbox::EvCleanup::enable(); Danga::Socket->EventLoop; $parent_pipe = undef; } diff --git a/lib/PublicInbox/EvCleanup.pm b/lib/PublicInbox/EvCleanup.pm index 384efd3..1a3a3d5 100644 --- a/lib/PublicInbox/EvCleanup.pm +++ b/lib/PublicInbox/EvCleanup.pm @@ -8,7 +8,9 @@ use warnings; use base qw(Danga::Socket); use fields qw(rd); -our $ENABLED; +my $ENABLED; +sub enabled { $ENABLED } +sub enable { $ENABLED = 1 } my $singleton; my $asapq = [ [], undef ]; my $nextq = [ [], undef ]; diff --git a/lib/PublicInbox/Inbox.pm b/lib/PublicInbox/Inbox.pm index f307038..666c81d 100644 --- a/lib/PublicInbox/Inbox.pm +++ b/lib/PublicInbox/Inbox.pm @@ -29,7 +29,7 @@ sub cleanup_task () { sub _cleanup_later ($) { my ($self) = @_; - return unless $PublicInbox::EvCleanup::ENABLED; + return unless PublicInbox::EvCleanup::enabled(); $cleanup_timer ||= PublicInbox::EvCleanup::later(*cleanup_task); $CLEANUP->{"$self"} = $self; } diff --git a/lib/PublicInbox/SearchMsg.pm b/lib/PublicInbox/SearchMsg.pm index de1fd13..dd3d58d 100644 --- a/lib/PublicInbox/SearchMsg.pm +++ b/lib/PublicInbox/SearchMsg.pm @@ -62,7 +62,7 @@ sub load_doc { sub bytes ($) { get_val($_[0]->{doc}, &PublicInbox::Search::BYTES) } sub lines ($) { get_val($_[0]->{doc}, &PublicInbox::Search::LINES) } sub num ($) { - $_[0]->{num} ||= get_val($_[0]->{doc}, PublicInbox::Search::NUM) + $_[0]->{num} ||= get_val($_[0]->{doc}, PublicInbox::Search::NUM()) } sub __hdr ($$) { -- EW