]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
t/cmd_ipc.t: allow EMSGSIZE send error for NetBSD
authorEric Wong <e@80x24.org>
Thu, 7 Sep 2023 00:54:07 +0000 (00:54 +0000)
committerEric Wong <e@80x24.org>
Thu, 7 Sep 2023 05:42:37 +0000 (05:42 +0000)
NetBSD sendmsg can error out with EMSGSIZE instead of EAGAIN or
ETOOMANYREFS when a socket is non-blocking and the reader isn't
keeping up.

t/cmd_ipc.t

index 403d0eed68c57834f759f3988abd1a2e84c7a853..7edfc92f3f4a0ec9d9b9c76d61913258a4078668 100644 (file)
@@ -80,13 +80,14 @@ my $do_test = sub { SKIP: {
                socketpair($s1, $s2, AF_UNIX, $type, 0) or BAIL_OUT $!;
                $s1->blocking(0);
                my $nsent = 0;
+               my $srclen = length($src);
                while (defined(my $n = $send->($s1, $sfds, $src, $flag))) {
                        $nsent += $n;
-                       fail "sent 0 bytes" if $n == 0;
+                       fail "sent $n bytes of $srclen" if $srclen != $n;
                }
-               ok($!{EAGAIN} || $!{ETOOMANYREFS},
-                       "hit EAGAIN || ETOOMANYREFS on send $desc") or
-                       diag "send failed with: $!";
+               ok($!{EAGAIN} || $!{ETOOMANYREFS} || $!{EMSGSIZE},
+                       "hit EAGAIN || ETOOMANYREFS || EMSGSIZE on send $desc")
+                       or diag "send failed with: $! (nsent=$nsent)";
                ok($nsent > 0, 'sent some bytes');
 
                socketpair($s1, $s2, AF_UNIX, $type, 0) or BAIL_OUT $!;