about summary refs log tree commit homepage
path: root/lib/PublicInbox
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-11-20 08:46:01 +0000
committerEric Wong <e@80x24.org>2023-11-20 15:33:08 +0000
commitd9a3750473e2e2fb13c8a4002be890772ee54330 (patch)
tree9837d8df2b25eb11408e9142b17889ab3e2cf403 /lib/PublicInbox
parent2d86b9efd38ec4e686cca098efad92541f156973 (diff)
downloadpublic-inbox-d9a3750473e2e2fb13c8a4002be890772ee54330.tar.gz
git: return upon self->close
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")
Diffstat (limited to 'lib/PublicInbox')
-rw-r--r--lib/PublicInbox/Git.pm4
1 files 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));
 }