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,AWL,BAYES_00, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, T_SCC_BODY_TEXT_LINE 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 7681B1F406 for ; Mon, 20 Nov 2023 08:46:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=80x24.org; s=selector1; t=1700469961; bh=i9vzL8L+lvYS9lvr1r9+4Q3v0Rz4OTMa9FEzHbQ437k=; h=From:To:Subject:Date:From; b=QNfyZAn4zSMIRgTXxsCo4bSgEnVECnylrGUkjBb3HOKGaiNnHAQd+mep936dzPCbV yGwFgzLlfkUfNPYoNt3a0drOlZSiuNx4HTdgyxADbf0VT1fXE6h0rfzh4eZ/I+hdYX SdYiwxI4u+vhcF7C95pR9LdylAFi64NwbMnqxMi4= From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] git: return upon self->close Date: Mon, 20 Nov 2023 08:46:01 +0000 Message-ID: <20231120084601.3393633-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: I encountered the odd lack of `return' while chasing Gcf2 bugs on CentOS 7.x which resulted in commit 7d06b126e939 ("gcf2: fix autodie usage for older Perl") and commit e618c7654794 ("gcf2client: add alias for PublicInbox::Git::fail") before realizing the lack of `return' here wasn't the culprit behind failures on CentOS 7.x. However, the use of a `return' here appears required in case we actually hit the error path, since falling through and attempting my_readline with an undefined filehandle is always a failure. Fixes: e97a30e7624d ("lei: fix SIGPIPE on large result sets to pager") --- lib/PublicInbox/Git.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index 292c359a..bef524aa 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -276,7 +276,7 @@ sub cat_async_step ($$) { sub cat_async_wait ($) { my ($self) = @_; - $self->close if !$self->{sock}; + return $self->close if !$self->{sock}; my $inflight = $self->{inflight} or return; while (scalar(@$inflight)) { cat_async_step($self, $inflight); @@ -332,7 +332,7 @@ sub check_async_wait ($) { my ($self) = @_; return cat_async_wait($self) if $self->{-bc}; my $ck = $self->{ck} or return; - $ck->close if !$ck->{sock}; + return $ck->close if !$ck->{sock}; my $inflight = $ck->{inflight} or return; check_async_step($ck, $inflight) while (scalar(@$inflight)); }