]> Sergey Matveev's repositories - public-inbox.git/commitdiff
convert: describe the release of fast-import pipes
authorEric Wong <e@yhbt.net>
Wed, 20 May 2020 07:38:08 +0000 (07:38 +0000)
committerEric Wong <e@yhbt.net>
Wed, 20 May 2020 23:58:12 +0000 (23:58 +0000)
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

index 7fb15adf69bc2e9db9b3fbf944b45052f7cfd94e..dbb2bd3800eba7ce1021f00eae8ed3665d629af6 100755 (executable)
@@ -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;