diff options
author | peter <peter@FreeBSD.org> | 1996-12-30 14:12:36 +0000 |
---|---|---|
committer | peter <peter@FreeBSD.org> | 1996-12-30 14:12:36 +0000 |
commit | 3f7f69c440e3515ba1e7a2b85eccaa91dc75feca (patch) | |
tree | d0b62aab1d6753e4217040b652dbe97e68425bd3 /lib/libc/rpc/bindresvport.c | |
parent | 55c2a4947b6ad40d28901906fbdc9983afd7a373 (diff) | |
download | FreeBSD-src-3f7f69c440e3515ba1e7a2b85eccaa91dc75feca.zip FreeBSD-src-3f7f69c440e3515ba1e7a2b85eccaa91dc75feca.tar.gz |
- Man page fix, updates.
- minor cosmetic tweaks
Obtained from: a diff of FreeBSD vs. OpenBSD/NetBSD rpc code.
Diffstat (limited to 'lib/libc/rpc/bindresvport.c')
-rw-r--r-- | lib/libc/rpc/bindresvport.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/libc/rpc/bindresvport.c b/lib/libc/rpc/bindresvport.c index 4411ba9..9508818 100644 --- a/lib/libc/rpc/bindresvport.c +++ b/lib/libc/rpc/bindresvport.c @@ -31,7 +31,7 @@ /*static char *sccsid = "from: @(#)bindresvport.c 1.8 88/02/08 SMI";*/ /*static char *sccsid = "from: @(#)bindresvport.c 2.2 88/07/29 4.0 RPCSRC";*/ /*from: OpenBSD: bindresvport.c,v 1.7 1996/07/30 16:25:47 downsj Exp */ -static char *rcsid = "$Id: bindresvport.c,v 1.4 1996/06/10 00:49:15 jraynard Exp $"; +static char *rcsid = "$Id: bindresvport.c,v 1.5 1996/08/12 14:09:46 peter Exp $"; #endif /* @@ -61,8 +61,8 @@ bindresvport(sd, sin) if (sin == (struct sockaddr_in *)0) { sin = &myaddr; - memset(sin, 0, sizeof(*sin)); - sin->sin_len = sizeof(*sin); + memset(sin, 0, sinlen); + sin->sin_len = sinlen; sin->sin_family = AF_INET; } else if (sin->sin_family != AF_INET) { errno = EPFNOSUPPORT; @@ -83,7 +83,7 @@ bindresvport(sd, sin) return(error); } - error = bind(sd, (struct sockaddr *)sin, sizeof(*sin)); + error = bind(sd, (struct sockaddr *)sin, sinlen); if (sin->sin_port == 0) { int saved_errno = errno; @@ -96,8 +96,6 @@ bindresvport(sd, sin) } if (sin != &myaddr) { - int sinlen = sizeof(*sin); - /* Hmm, what did the kernel assign... */ if (getsockname(sd, (struct sockaddr *)sin, &sinlen) < 0) |