From 267371b1273b518215939e817e53733584b68af7 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 29 Dec 2019 12:51:18 +0000 Subject: spawn: allow passing GLOB handles for redirects We can save callers the trouble of {-hold} and {-dev_null} refs as well as the trouble of calling fileno(). --- t/spawn.t | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 't/spawn.t') diff --git a/t/spawn.t b/t/spawn.t index 2e409157..c31c4f19 100644 --- a/t/spawn.t +++ b/t/spawn.t @@ -31,7 +31,7 @@ use PublicInbox::Spawn qw(which spawn popen_rd); my ($r, $w); pipe $r, $w or die "pipe failed: $!"; my $pid = spawn(['sh', '-c', 'echo $HELLO'], - { 'HELLO' => 'world' }, { 1 => fileno($w) }); + { 'HELLO' => 'world' }, { 1 => $w }); close $w or die "close pipe[1] failed: $!"; is(<$r>, "world\n", 'read stdout of spawned from pipe'); is(waitpid($pid, 0), $pid, 'waitpid succeeds on spawned process'); -- cgit v1.2.3-24-ge0c7