From: Eric Wong Date: Thu, 7 Sep 2023 00:54:07 +0000 (+0000) Subject: t/cmd_ipc.t: allow EMSGSIZE send error for NetBSD X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59fc5e84cafae4bb4ddc7dab79a89444bbf8ba13;p=thirdparty%2Fpublic-inbox.git t/cmd_ipc.t: allow EMSGSIZE send error for NetBSD 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. --- diff --git a/t/cmd_ipc.t b/t/cmd_ipc.t index 403d0eed6..7edfc92f3 100644 --- a/t/cmd_ipc.t +++ b/t/cmd_ipc.t @@ -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 $!;