about summary refs log tree commit homepage
path: root/script
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2023-08-30 05:10:39 +0000
committerEric Wong <e@80x24.org>2023-08-30 05:27:32 +0000
commit900cb902886ce7aa257b866bcf8380f1b935c64a (patch)
treea7e0e30648754a1d07e9640d7dfc8607a1dc72f2 /script
parent1ea097fe25d3717ad0b8e232268a6d55d8ed7225 (diff)
downloadpublic-inbox-900cb902886ce7aa257b866bcf8380f1b935c64a.tar.gz
It's apparently not needed for AF_UNIX + SOCK_SEQPACKET as our
receivers never check for MSG_EOR in "struct msghdr".msg_flags
anyways.  I don't believe POSIX is clear on the exact semantics
of MSG_EOR on this socket type.  This works around truncation
problems on OpenBSD recvmsg when MSG_EOR is used by the sender.

Link: https://marc.info/?i=20230826020759.M335788@dcvr
Diffstat (limited to 'script')
-rwxr-xr-xscript/lei10
1 files changed, 5 insertions, 5 deletions
diff --git a/script/lei b/script/lei
index 5feb7751..a77ea880 100755
--- a/script/lei
+++ b/script/lei
@@ -2,7 +2,7 @@
 # Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 use v5.12;
-use Socket qw(AF_UNIX SOCK_SEQPACKET MSG_EOR pack_sockaddr_un);
+use Socket qw(AF_UNIX SOCK_SEQPACKET pack_sockaddr_un);
 use PublicInbox::CmdIPC4;
 my $narg = 5;
 my $sock;
@@ -109,9 +109,9 @@ open my $dh, '<', '.' or die "open(.) $!";
 my $buf = join("\0", scalar(@ARGV), @ARGV);
 while (my ($k, $v) = each %ENV) { $buf .= "\0$k=$v" }
 $buf .= "\0\0";
-$send_cmd->($sock, [0, 1, 2, fileno($dh)], $buf, MSG_EOR) or die "sendmsg: $!";
-$SIG{TSTP} = sub { send($sock, 'STOP', MSG_EOR); kill 'STOP', $$ };
-$SIG{CONT} = sub { send($sock, 'CONT', MSG_EOR) };
+$send_cmd->($sock, [0, 1, 2, fileno($dh)], $buf, 0) or die "sendmsg: $!";
+$SIG{TSTP} = sub { send($sock, 'STOP', 0); kill 'STOP', $$ };
+$SIG{CONT} = sub { send($sock, 'CONT', 0) };
 
 my $x_it_code = 0;
 while (1) {
@@ -126,7 +126,7 @@ while (1) {
         } elsif ($buf eq '-WINCH') {
                 kill($buf, @parent); # for MUA
         } elsif ($buf eq 'umask') {
-                send($sock, 'u'.pack('V', umask), MSG_EOR) or die "send: $!"
+                send($sock, 'u'.pack('V', umask), 0) or die "send: $!"
         } elsif ($buf =~ /\Ax_it ([0-9]+)\z/) {
                 $x_it_code ||= $1 + 0;
                 last;