about summary refs log tree commit homepage
path: root/lib/PublicInbox/Spawn.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2016-02-29 00:56:20 +0000
committerEric Wong <e@80x24.org>2016-02-29 01:04:25 +0000
commit79d9b48a0fa8c9158377fa120be25468f6aab1b8 (patch)
treeef33040c147313de0d010aaf2265426dd0646daf /lib/PublicInbox/Spawn.pm
parent1c0cfc8726c1c5e4085ad43bdf533b91af88e971 (diff)
downloadpublic-inbox-79d9b48a0fa8c9158377fa120be25468f6aab1b8.tar.gz
This makes for better compile-time checking and also helps
document which calls are private for HTTP and NNTP.

While we're at it, use IO::Handle::* functions procedurally,
too, since we know we're working with native glob handles.
Diffstat (limited to 'lib/PublicInbox/Spawn.pm')
-rw-r--r--lib/PublicInbox/Spawn.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/PublicInbox/Spawn.pm b/lib/PublicInbox/Spawn.pm
index 02c5446f..23f303fb 100644
--- a/lib/PublicInbox/Spawn.pm
+++ b/lib/PublicInbox/Spawn.pm
@@ -15,6 +15,7 @@ use strict;
 use warnings;
 use base qw(Exporter);
 use Symbol qw(gensym);
+use IO::Handle;
 use PublicInbox::ProcessPipe;
 our @EXPORT_OK = qw/which spawn popen_rd/;
 
@@ -168,7 +169,7 @@ sub popen_rd {
         pipe(my ($r, $w)) or die "pipe: $!\n";
         $opts ||= {};
         my $blocking = $opts->{Blocking};
-        $r->blocking($blocking) if defined $blocking;
+        IO::Handle::blocking($r, $blocking) if defined $blocking;
         $opts->{1} = fileno($w);
         my $pid = spawn($cmd, $env, $opts);
         return ($r, $pid) if wantarray;