From 7eda704e4ec5b2ab897ef8da4fc90c48fcfc45a9 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Wed, 20 May 2020 07:38:08 +0000 Subject: convert: describe the release of fast-import pipes 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; -- cgit v1.2.3-24-ge0c7