From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-Status: No, score=-4.0 required=3.0 tests=ALL_TRUSTED,BAYES_00 shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 6E7C120082 for ; Tue, 2 Feb 2021 11:47:03 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 10/16] cmd_ipc4: fix comments and formatting Date: Tue, 2 Feb 2021 11:46:56 +0000 Message-Id: <20210202114702.29886-11-e@80x24.org> In-Reply-To: <20210202114702.29886-1-e@80x24.org> References: <20210202114702.29886-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit List-Id: --- lib/PublicInbox/CmdIPC4.pm | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/PublicInbox/CmdIPC4.pm b/lib/PublicInbox/CmdIPC4.pm index c244f6a1..74dbf8a1 100644 --- a/lib/PublicInbox/CmdIPC4.pm +++ b/lib/PublicInbox/CmdIPC4.pm @@ -3,7 +3,7 @@ # callers should use PublicInbox::CmdIPC4->can('send_cmd4') (or recv_cmd4) # first choice for script/lei front-end and 2nd choice for lei backend -# libsocket-msghdr-perl is in Debian but many other distros as of 2021. +# libsocket-msghdr-perl is in Debian but not many other distros as of 2021. package PublicInbox::CmdIPC4; use strict; use v5.10.1; @@ -12,12 +12,11 @@ BEGIN { eval { require Socket::MsgHdr; # XS no warnings 'once'; -# 3 FDs per-sendmsg(2) + buffer +# any number of FDs per-sendmsg(2) + buffer *send_cmd4 = sub ($$$$) { # (sock, fds, buf, flags) = @_; my ($sock, $fds, undef, $flags) = @_; my $mh = Socket::MsgHdr->new(buf => $_[2]); - $mh->cmsghdr(SOL_SOCKET, SCM_RIGHTS, - pack('i' x scalar(@$fds), @$fds)); + $mh->cmsghdr(SOL_SOCKET, SCM_RIGHTS, pack('i' x scalar(@$fds), @$fds)); Socket::MsgHdr::sendmsg($sock, $mh, $flags); };