From 3019046b3ab9736922762df111d60ef7647e36a3 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 10 Jan 2021 12:15:18 +0000 Subject: lei_xsearch: transfer 4 FDs internally, drop IO::FDPass It's easier to make the code more generic by transferring all four FDs (std(in|out|err) + socket) instead of omitting stdin. We'll be reading from stdin on some imports, and possibly outputting to stdout, so omitting stdin now would needlessly complicate things. The differences with IO::FDPass "1" code paths and the "4" code paths used by Inline::C and Socket::MsgHdr are far too much to support and test at the moment. --- script/lei | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'script/lei') diff --git a/script/lei b/script/lei index aac8fa94..5c32ab88 100755 --- a/script/lei +++ b/script/lei @@ -8,11 +8,6 @@ use PublicInbox::CmdIPC4; my $narg = 4; my $recv_cmd = PublicInbox::CmdIPC4->can('recv_cmd4'); my $send_cmd = PublicInbox::CmdIPC4->can('send_cmd4') // do { - require PublicInbox::CmdIPC1; # 2nd choice - $narg = 1; - $recv_cmd = PublicInbox::CmdIPC1->can('recv_cmd1'); - PublicInbox::CmdIPC1->can('send_cmd1'); -} // do { require PublicInbox::Spawn; # takes ~50ms even if built *sigh* $narg = 4; $recv_cmd = PublicInbox::Spawn->can('recv_cmd4'); @@ -77,7 +72,7 @@ Falling back to (slow) one-shot mode $pwd = $cwd; } 1; -}) { # (Socket::MsgHdr|IO::FDPass|Inline::C), $sock, $pwd are all available: +}) { # (Socket::MsgHdr|Inline::C), $sock, $pwd are all available: local $ENV{PWD} = $pwd; my $buf = join("\0", scalar(@ARGV), @ARGV); while (my ($k, $v) = each %ENV) { $buf .= "\0$k=$v" } @@ -94,7 +89,7 @@ Falling back to (slow) one-shot mode die $buf; } } -} else { # for systems lacking Socket::MsgHdr, IO::FDPass or Inline::C +} else { # for systems lacking Socket::MsgHdr or Inline::C warn $@ if $@; require PublicInbox::LEI; PublicInbox::LEI::oneshot(__PACKAGE__); -- cgit v1.2.3-24-ge0c7