diff options
author | Eric Wong <e@80x24.org> | 2021-01-03 11:24:50 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-01-03 18:24:08 +0000 |
commit | b156cb4ef176b41131154a6d7632aed92b143fa0 (patch) | |
tree | 46b13794fbc87a2b0133a1f450328f0b35e0539d /script | |
parent | 0939882b8a883e3f034bd059cdec4984d36f4ac7 (diff) | |
download | public-inbox-b156cb4ef176b41131154a6d7632aed92b143fa0.tar.gz |
We'll always be transferring stdin, stdout, and stderr together for lei. Perhaps I lack imagination or foresight, but I can't think of a reason to send more or less FDs.
Diffstat (limited to 'script')
-rwxr-xr-x | script/lei | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -4,10 +4,10 @@ use strict; use v5.10.1; use Socket qw(AF_UNIX SOCK_STREAM pack_sockaddr_un); -my $send_fd; +my $send_3fds; if (my ($sock, $pwd) = eval { require PublicInbox::Spawn; - $send_fd = PublicInbox::Spawn->can('send_fd') or die + $send_3fds = PublicInbox::Spawn->can('send_3fds') or die "Inline::C not installed/configured or IO::FDPass missing\n"; my $path = do { my $runtime_dir = ($ENV{XDG_RUNTIME_DIR} // '') . '/lei'; @@ -60,7 +60,7 @@ Falling back to (slow) one-shot mode $buf .= "\0\0"; select $sock; $| = 1; # unbuffer selected $sock - $send_fd->(fileno($sock), $_) for (0..2); + $send_3fds->(fileno($sock), 0, 1, 2); print $sock $buf or die "print(sock, buf): $!"; while ($buf = <$sock>) { $buf =~ /\Aexit=([0-9]+)\n\z/ and exit($1 + 0); |