summaryrefslogtreecommitdiffstats
path: root/contrib/netbsd-tests/lib/libc
diff options
context:
space:
mode:
authorngie <ngie@FreeBSD.org>2017-01-07 08:24:49 +0000
committerngie <ngie@FreeBSD.org>2017-01-07 08:24:49 +0000
commit733659d4511f6c512213b585fa20b5fb34c10761 (patch)
tree4c340d07d1c266d4ed3a31073921cd73666e985e /contrib/netbsd-tests/lib/libc
parent48c52037f1bc72ebb3bc99ec496f38e670ff2e5c (diff)
downloadFreeBSD-src-733659d4511f6c512213b585fa20b5fb34c10761.zip
FreeBSD-src-733659d4511f6c512213b585fa20b5fb34c10761.tar.gz
MFC r311242:
listen_low_port: check for errors from socket(2) before continuing CID: 976778
Diffstat (limited to 'contrib/netbsd-tests/lib/libc')
-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