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 9D0CE1F87F for ; Sat, 1 Jun 2019 03:37:09 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/2] git: drop the deleted err_c file Date: Sat, 1 Jun 2019 03:37:06 +0000 Message-Id: <20190601033706.18113-3-e@80x24.org> In-Reply-To: <20190601033706.18113-1-e@80x24.org> References: <20190601033706.18113-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: No reason to leave that (usually) empty file open after killing off "cat-file --batch-check". This wasn't an unbound leak, though, as respawning the --batch-check process would've clobbered the old err_c file. --- lib/PublicInbox/Git.pm | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/PublicInbox/Git.pm b/lib/PublicInbox/Git.pm index 9a38d7c..9014e02 100644 --- a/lib/PublicInbox/Git.pm +++ b/lib/PublicInbox/Git.pm @@ -211,9 +211,10 @@ sub check { } sub _destroy { - my ($self, $in, $out, $pid) = @_; + my ($self, $in, $out, $pid, $err) = @_; my $p = delete $self->{$pid} or return; delete @$self{($in, $out)}; + delete $self->{$err} if $err; # `err_c' waitpid $p, 0; } @@ -243,7 +244,7 @@ sub qx { sub cleanup { my ($self) = @_; _destroy($self, qw(in out pid)); - _destroy($self, qw(in_c out_c pid_c)); + _destroy($self, qw(in_c out_c pid_c err_c)); !!($self->{pid} || $self->{pid_c}); } -- EW