From 00fe4ec336dcd8fcf3c45498d7f1ae5c228c6b92 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Fri, 6 Oct 2023 01:02:58 +0000 Subject: ipc: lower-level send_cmd/recv_cmd handle EINTR directly This ensures script/lei $send_cmd usage is EINTR-safe (since I prefer to avoid loading PublicInbox::IPC for startup time). Overall, it saves us some code, too. --- lib/PublicInbox/LeiSelfSocket.pm | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'lib/PublicInbox/LeiSelfSocket.pm') diff --git a/lib/PublicInbox/LeiSelfSocket.pm b/lib/PublicInbox/LeiSelfSocket.pm index b8745252..0e15bc7c 100644 --- a/lib/PublicInbox/LeiSelfSocket.pm +++ b/lib/PublicInbox/LeiSelfSocket.pm @@ -21,7 +21,8 @@ sub new { sub event_step { my ($self) = @_; - my @fds = PublicInbox::IPC::recv_cmd($self->{sock}, my $buf, 4096 * 33); + my ($buf, @fds); + @fds = $PublicInbox::IPC::recv_cmd->($self->{sock}, $buf, 4096 * 33); if (scalar(@fds) == 1 && !defined($fds[0])) { return if $!{EAGAIN}; die "recvmsg: $!" unless $!{ECONNRESET}; -- cgit v1.2.3-24-ge0c7