diff options
Diffstat (limited to '')
-rw-r--r-- | src/lib/libc/net/rresvport.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libc/net/rresvport.c b/src/lib/libc/net/rresvport.c index 6b45000f7b..72c27c3a3f 100644 --- a/src/lib/libc/net/rresvport.c +++ b/src/lib/libc/net/rresvport.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rresvport.c,v 1.11 2015/09/12 14:56:50 guenther Exp $ */ | 1 | /* $OpenBSD: rresvport.c,v 1.12 2019/06/28 13:32:42 deraadt Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 1995, 1996, 1998 Theo de Raadt. All rights reserved. | 3 | * Copyright (c) 1995, 1996, 1998 Theo de Raadt. All rights reserved. |
4 | * Copyright (c) 1983, 1993, 1994 | 4 | * Copyright (c) 1983, 1993, 1994 |
@@ -82,12 +82,12 @@ rresvport_af(int *alport, int af) | |||
82 | sa->sa_family = af; | 82 | sa->sa_family = af; |
83 | 83 | ||
84 | s = socket(af, SOCK_STREAM, 0); | 84 | s = socket(af, SOCK_STREAM, 0); |
85 | if (s < 0) | 85 | if (s == -1) |
86 | return (-1); | 86 | return (-1); |
87 | 87 | ||
88 | *portp = htons(*alport); | 88 | *portp = htons(*alport); |
89 | if (*alport < IPPORT_RESERVED - 1) { | 89 | if (*alport < IPPORT_RESERVED - 1) { |
90 | if (bind(s, sa, sa->sa_len) >= 0) | 90 | if (bind(s, sa, sa->sa_len) != -1) |
91 | return (s); | 91 | return (s); |
92 | if (errno != EADDRINUSE) { | 92 | if (errno != EADDRINUSE) { |
93 | (void)close(s); | 93 | (void)close(s); |