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. --- lib/PublicInbox/LeiXSearch.pm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'lib/PublicInbox/LeiXSearch.pm') diff --git a/lib/PublicInbox/LeiXSearch.pm b/lib/PublicInbox/LeiXSearch.pm index 241b9dab..5443188d 100644 --- a/lib/PublicInbox/LeiXSearch.pm +++ b/lib/PublicInbox/LeiXSearch.pm @@ -353,14 +353,14 @@ print STDERR $_; $lei, $each_smsg); $lei->sto_done_request if delete($self->{-sto_imported}); my $nr = delete $lei->{-nr_remote_eml} // 0; - close $cfh; + $cfh->close; my $code = $?; if (!$code) { # don't update if no results, maybe MTA is down $lei->{lss}->cfg_set($key, $start) if $key && $nr; mset_progress($lei, $lei->{-current_url}, $nr, $nr); next; } - close(delete($rdr->{2})) if @lbf_tee; + delete($rdr->{2})->close if @lbf_tee; seek($cerr, 0, SEEK_SET); read($cerr, my $err, -s $cerr); truncate($cerr, 0); @@ -396,8 +396,8 @@ sub query_done { # EOF callback for main daemon $lei->{ovv}->ovv_end($lei); if ($l2m) { # close() calls LeiToMail reap_compress if (my $out = delete $lei->{old_1}) { - if (my $mbout = $lei->{1}) { - close($mbout) or die <<""; + if (my $mbout = $lei->{1}) { # compressor pipe process + $mbout->close or die <<""; Error closing $lei->{ovv}->{dst}: \$!=$! \$?=$? } -- cgit v1.2.3-24-ge0c7