about summary refs log tree commit homepage
path: root/script
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-01-03 09:48:42 +0000
committerEric Wong <e@80x24.org>2021-01-03 18:24:02 +0000
commit0939882b8a883e3f034bd059cdec4984d36f4ac7 (patch)
tree30eca9c9e77272bc255a0eafccacdf74e03104c2 /script
parent45f8f0fefb56723efe1b8ab0a1c041f5196e7a20 (diff)
downloadpublic-inbox-0939882b8a883e3f034bd059cdec4984d36f4ac7.tar.gz
IO::FDPass may be an extra installation burden I don't want to
impose on users.  We only support Linux and *BSDs, however.
Diffstat (limited to 'script')
-rwxr-xr-xscript/lei7
1 files changed, 5 insertions, 2 deletions
diff --git a/script/lei b/script/lei
index ff4dcd45..67e8b8b0 100755
--- a/script/lei
+++ b/script/lei
@@ -4,8 +4,11 @@
 use strict;
 use v5.10.1;
 use Socket qw(AF_UNIX SOCK_STREAM pack_sockaddr_un);
+my $send_fd;
 if (my ($sock, $pwd) = eval {
-        require IO::FDPass; # will try to use a daemon to reduce load time
+        require PublicInbox::Spawn;
+        $send_fd = PublicInbox::Spawn->can('send_fd') or die
+                "Inline::C not installed/configured or IO::FDPass missing\n";
         my $path = do {
                 my $runtime_dir = ($ENV{XDG_RUNTIME_DIR} // '') . '/lei';
                 if ($runtime_dir eq '/lei') {
@@ -57,7 +60,7 @@ Falling back to (slow) one-shot mode
         $buf .= "\0\0";
         select $sock;
         $| = 1; # unbuffer selected $sock
-        IO::FDPass::send(fileno($sock), $_) for (0..2);
+        $send_fd->(fileno($sock), $_) for (0..2);
         print $sock $buf or die "print(sock, buf): $!";
         while ($buf = <$sock>) {
                 $buf =~ /\Aexit=([0-9]+)\n\z/ and exit($1 + 0);