From d3c55d072839286efb2865fe20f2324a9e595e95 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 2 Nov 2023 09:35:30 +0000 Subject: 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. --- xt/git_async_cmp.t | 4 ++-- xt/httpd-async-stream.t | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'xt') 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; }; -- cgit v1.2.3-24-ge0c7