diff options
author | Damien Miller <djm@mindrot.org> | 2001-01-25 10:32:00 +1100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2001-01-25 10:32:00 +1100 |
commit | 2a5c1cede026faec14b0903a0cdcc4e7ef554e32 (patch) | |
tree | 2534f2a4499b295d01521a5fe90aa1ba9eeb9146 /bsd-rresvport.c | |
parent | 12aaa04e96be85a684d3f90db46bb62689796a93 (diff) |
- (djm) Sync bsd-* support files:
- deraadt@cvs.openbsd.org 2000/01/26 03:43:20
[rresvport.c bindresvport.c]
new bindresvport() semantics that itojun, shin, jean-luc and i have
agreed on, which will be happy for the future. bindresvport_sa() for
sockaddr *, too. docs later..
- deraadt@cvs.openbsd.org 2000/01/24 02:24:21
[bindresvport.c]
in bindresvport(), if sin is non-NULL, example sin->sin_family for
the actual family being processed
Diffstat (limited to 'bsd-rresvport.c')
-rw-r--r-- | bsd-rresvport.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/bsd-rresvport.c b/bsd-rresvport.c index 392768c02..44eac2036 100644 --- a/bsd-rresvport.c +++ b/bsd-rresvport.c | |||
@@ -38,7 +38,7 @@ | |||
38 | #ifndef HAVE_RRESVPORT_AF | 38 | #ifndef HAVE_RRESVPORT_AF |
39 | 39 | ||
40 | #if defined(LIBC_SCCS) && !defined(lint) | 40 | #if defined(LIBC_SCCS) && !defined(lint) |
41 | static char *rcsid = "$OpenBSD: rresvport.c,v 1.4 1999/12/17 20:48:03 deraadt Exp $"; | 41 | static char *rcsid = "$OpenBSD: rresvport.c,v 1.5 2000/01/26 03:43:20 deraadt Exp $"; |
42 | #endif /* LIBC_SCCS and not lint */ | 42 | #endif /* LIBC_SCCS and not lint */ |
43 | 43 | ||
44 | #include "includes.h" | 44 | #include "includes.h" |
@@ -94,7 +94,8 @@ rresvport_af(int *alport, sa_family_t af) | |||
94 | } | 94 | } |
95 | 95 | ||
96 | *portp = 0; | 96 | *portp = 0; |
97 | if (bindresvport_af(s, sa, af) == -1) { | 97 | sa->sa_family = af; |
98 | if (bindresvport_sa(s, sa) == -1) { | ||
98 | (void)close(s); | 99 | (void)close(s); |
99 | return (-1); | 100 | return (-1); |
100 | } | 101 | } |