diff options
author | Eric Wong <e@80x24.org> | 2023-11-09 10:09:46 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2023-11-09 21:53:55 +0000 |
commit | f3133719702954356caa3de4c7c26c667f1094d8 (patch) | |
tree | 2fcb2f95cac384376d649f56fe3714c5fc0b0329 /lib/PublicInbox/Spawn.pm | |
parent | e15a6fb8ba95295d3e9a5c38054b96f18b038781 (diff) | |
download | public-inbox-f3133719702954356caa3de4c7c26c667f1094d8.tar.gz |
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.
Diffstat (limited to 'lib/PublicInbox/Spawn.pm')
-rw-r--r-- | lib/PublicInbox/Spawn.pm | 6 |
1 files changed, 2 insertions, 4 deletions
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 ($) { |