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(). --- lib/PublicInbox/V2Writable.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/PublicInbox/V2Writable.pm') diff --git a/lib/PublicInbox/V2Writable.pm b/lib/PublicInbox/V2Writable.pm index 77b3bde4..c614e20c 100644 --- a/lib/PublicInbox/V2Writable.pm +++ b/lib/PublicInbox/V2Writable.pm @@ -473,7 +473,7 @@ sub git_hash_raw ($$) { my ($r, $w); pipe($r, $w) or die "failed to create pipe: $!"; - my $rdr = { 0 => fileno($tmp_fh), 1 => fileno($w) }; + my $rdr = { 0 => $tmp_fh, 1 => $w }; my $git_dir = $self->{-inbox}->git->{git_dir}; my $cmd = ['git', "--git-dir=$git_dir", qw(hash-object --stdin)]; my $pid = spawn($cmd, undef, $rdr); -- cgit v1.2.3-24-ge0c7