diff options
author | Eric Wong <e@80x24.org> | 2023-11-02 09:35:30 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-11-03 06:39:28 +0000 |
commit | d3c55d072839286efb2865fe20f2324a9e595e95 (patch) | |
tree | c3a7b450e22a0e9d7e849d53884f6af8af19cee5 /xt | |
parent | 19f9089343c9e579253db756f2131ee493718ead (diff) | |
download | public-inbox-d3c55d072839286efb2865fe20f2324a9e595e95.tar.gz |
treewide: use ->close to call ProcessIO->CLOSE
This will open the door for us to drop `tie' usage from ProcessIO completely in favor of OO method dispatch. While OO method dispatches (e.g. `$fh->close') are slower than normal subroutine calls, it hardly matters in this case since process teardown is a fairly rare operation and we continue to use `close($fh)' for Maildir writes.
Diffstat (limited to 'xt')
-rw-r--r-- | xt/git_async_cmp.t | 4 | ||||
-rw-r--r-- | xt/httpd-async-stream.t | 2 |
2 files changed, 3 insertions, 3 deletions
diff --git a/xt/git_async_cmp.t b/xt/git_async_cmp.t index 9edc1f37..4038898b 100644 --- a/xt/git_async_cmp.t +++ b/xt/git_async_cmp.t @@ -31,7 +31,7 @@ my $async = timeit($nr, sub { my ($oid, undef, undef) = split(/ /); $git->cat_async($oid, $cb); } - close $cat or die "cat: $?"; + $cat->close or xbail "cat: $?"; $git->async_wait_all; push @dig, ['async', $dig->hexdigest ]; }); @@ -44,7 +44,7 @@ my $sync = timeit($nr, sub { my $bref = $git->cat_file($oid); $dig->add($$bref); } - close $cat or die "cat: $?"; + $cat->close or xbail "cat: $?"; push @dig, ['sync', $dig->hexdigest ]; }); diff --git a/xt/httpd-async-stream.t b/xt/httpd-async-stream.t index 904f2ae9..099ceb79 100644 --- a/xt/httpd-async-stream.t +++ b/xt/httpd-async-stream.t @@ -67,7 +67,7 @@ my $do_get_all = sub { } my $res = $dig->hexdigest; my $elapsed = sprintf('%0.3f', now() - $t0); - close $rd or die "close curl failed: $! \$?=$?\n"; + $rd->close or xbail "close curl failed: $! \$?=$?\n"; print STDERR "# $job $$ ($?) $res (${elapsed}s) $bytes bytes\n"; $res; }; |