From f3133719702954356caa3de4c7c26c667f1094d8 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Thu, 9 Nov 2023 10:09:46 +0000 Subject: spawn: get rid of wantarray popen_rd/popen_wr We've updated all of our users to use Process::IO (and avoiding tied handles) so the trade-off for using the array context no longer exists. --- lib/PublicInbox/Spawn.pm | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'lib/PublicInbox/Spawn.pm') diff --git a/lib/PublicInbox/Spawn.pm b/lib/PublicInbox/Spawn.pm index 8c798b39..8cc4dfaf 100644 --- a/lib/PublicInbox/Spawn.pm +++ b/lib/PublicInbox/Spawn.pm @@ -384,16 +384,14 @@ sub spawn ($;$$) { sub popen_rd { my ($cmd, $env, $opt, @cb_arg) = @_; pipe(my $r, local $opt->{1}); - my $pid = spawn($cmd, $env, $opt); - wantarray ? ($r, $pid) : PublicInbox::IO::attach_pid($r, $pid, @cb_arg) + PublicInbox::IO::attach_pid($r, spawn($cmd, $env, $opt), @cb_arg); } sub popen_wr { my ($cmd, $env, $opt, @cb_arg) = @_; pipe(local $opt->{0}, my $w); $w->autoflush(1); - my $pid = spawn($cmd, $env, $opt); - wantarray ? ($w, $pid) : PublicInbox::IO::attach_pid($w, $pid, @cb_arg) + PublicInbox::IO::attach_pid($w, spawn($cmd, $env, $opt), @cb_arg); } sub read_out_err ($) { -- cgit v1.2.3-24-ge0c7