summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarius eriksen <marius@cvs.openbsd.org>2005-07-24 09:33:57 +0000
committermarius eriksen <marius@cvs.openbsd.org>2005-07-24 09:33:57 +0000
commit01de6f1c7d84e1f5236132dd37a6b59705a43902 (patch)
tree37cfa46ceb7481a9e7c7de667bc7b55972046042
parent73299b7d87d8cd7e18a67a0517f8f13291798f7d (diff)
correct rval check for socket(). from alf schlichting. ok markus@
-rw-r--r--usr.bin/nc/netcat.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/nc/netcat.c b/usr.bin/nc/netcat.c
index a8b4ac38397..c298ade67f9 100644
--- a/usr.bin/nc/netcat.c
+++ b/usr.bin/nc/netcat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netcat.c,v 1.81 2005/05/28 16:57:48 marius Exp $ */
+/* $OpenBSD: netcat.c,v 1.82 2005/07/24 09:33:56 marius Exp $ */
/*
* Copyright (c) 2001 Eric Jackson <ericj@monkey.org>
*
@@ -544,7 +544,7 @@ local_listen(char *host, char *port, struct addrinfo hints)
res0 = res;
do {
if ((s = socket(res0->ai_family, res0->ai_socktype,
- res0->ai_protocol)) == 0)
+ res0->ai_protocol)) < 0)
continue;
ret = setsockopt(s, SOL_SOCKET, SO_REUSEPORT, &x, sizeof(x));