summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2017-01-07 08:25:09 +0000
committerngie <ngie@FreeBSD.org>2017-01-07 08:25:09 +0000
commit8204431b706c0df4fe47b721c5618da77daf0f91 (patch)
tree6c82da8c148e981b974f046e1b273303b95fc562 /contrib/netbsd-tests
parent533e94c09b371da1caf9da9cb58e46c467d391f3 (diff)
downloadFreeBSD-src-8204431b706c0df4fe47b721c5618da77daf0f91.zip
FreeBSD-src-8204431b706c0df4fe47b721c5618da77daf0f91.tar.gz
MFC r311242:
listen_low_port: check for errors from socket(2) before continuing CID: 976778
Diffstat (limited to 'contrib/netbsd-tests')
-rw-r--r--contrib/netbsd-tests/lib/libc/sys/t_listen.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/contrib/netbsd-tests/lib/libc/sys/t_listen.c b/contrib/netbsd-tests/lib/libc/sys/t_listen.c
index d7c7d9e..a9ee733 100644
--- a/contrib/netbsd-tests/lib/libc/sys/t_listen.c
+++ b/contrib/netbsd-tests/lib/libc/sys/t_listen.c
@@ -110,6 +110,9 @@ ATF_TC_BODY(listen_low_port, tc)
int sd, val;
sd = socket(AF_INET, SOCK_STREAM, 0);
+#ifdef __FreeBSD__
+ ATF_REQUIRE_MSG(sd != -1, "socket failed: %s", strerror(errno));
+#endif
val = IP_PORTRANGE_LOW;
if (setsockopt(sd, IPPROTO_IP, IP_PORTRANGE, &val,
OpenPOWER on IntegriCloud