diff options
author | Eric Wong <e@80x24.org> | 2022-03-23 08:54:34 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2022-03-23 18:39:02 +0000 |
commit | 215e2138c99d48e2061eb98aef5a6da1bc3ff828 (patch) | |
tree | f66103b08aa26b9fa9a02bee1e4f645fb7c3d98c | |
parent | 6ab6029bc99fe3b7f41eb19164542d0264a80380 (diff) | |
download | public-inbox-215e2138c99d48e2061eb98aef5a6da1bc3ff828.tar.gz |
It's a waste of ops and cycles, and inconsistent with perl sysread() behavior which doesn't touch the supplied buffer on errors.
-rw-r--r-- | lib/PublicInbox/CmdIPC4.pm | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/PublicInbox/CmdIPC4.pm b/lib/PublicInbox/CmdIPC4.pm index c3a7f56e..76938b6d 100644 --- a/lib/PublicInbox/CmdIPC4.pm +++ b/lib/PublicInbox/CmdIPC4.pm @@ -1,4 +1,4 @@ -# Copyright (C) 2020-2021 all contributors <meta@public-inbox.org> +# Copyright (C) all contributors <meta@public-inbox.org> # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt> # callers should use PublicInbox::CmdIPC4->can('send_cmd4') (or recv_cmd4) @@ -32,7 +32,7 @@ no warnings 'once'; *recv_cmd4 = sub ($$$) { my ($s, undef, $len) = @_; # $_[1] = destination buffer my $mh = Socket::MsgHdr->new(buflen => $len, controllen => 256); - my $r = Socket::MsgHdr::recvmsg($s, $mh, 0) // return ($_[1] = undef); + my $r = Socket::MsgHdr::recvmsg($s, $mh, 0) // return (undef); $_[1] = $mh->buf; return () if $r == 0; my (undef, undef, $data) = $mh->cmsghdr; |