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-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 A37C81F55B for ; Wed, 20 May 2020 07:38:08 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH] convert: describe the release of fast-import pipes Date: Wed, 20 May 2020 07:38:08 +0000 Message-Id: <20200520073808.27837-1-e@yhbt.net> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: Upon rereading the code, it wasn't immediately obvious to me why we didn't check for errors with `close($w)' instead of relying on `undef'. So add a comment for the benefit of future readers. --- script/public-inbox-convert | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/script/public-inbox-convert b/script/public-inbox-convert index 7fb15adf..dbb2bd38 100755 --- a/script/public-inbox-convert +++ b/script/public-inbox-convert @@ -144,10 +144,10 @@ while (<$rd>) { last if $_ eq "done\n"; print $w $_ or $im->wfail; } -$w = $r = undef; close $rd or die "close fast-export: $!\n"; waitpid($pid, 0) or die "waitpid failed: $!\n"; $? == 0 or die "fast-export failed: $?\n"; +$r = $w = undef; # v2w->done does the actual close and error checking $v2w->done; if (my $mm = $old->mm) { $old->cleanup;