summaryrefslogtreecommitdiffstats
path: root/lib/libc/rpc/bindresvport.c
diff options
context:
space:
mode:
authortholo <tholo@openbsd.org>1996-09-15 09:30:42 +0000
committertholo <tholo@openbsd.org>1996-09-15 09:30:42 +0000
commitc8f91e0d750eb1dd5aa79a93a20a522c47067c28 (patch)
tree151e2a572b80f59c243874a0738c218470cf1bc0 /lib/libc/rpc/bindresvport.c
parentprint debugging flags in usage(); idea from freebsd (diff)
downloadwireguard-openbsd-c8f91e0d750eb1dd5aa79a93a20a522c47067c28.tar.xz
wireguard-openbsd-c8f91e0d750eb1dd5aa79a93a20a522c47067c28.zip
Remove dead code
Remove unused variables Silence some warnings lint(1) is your friend
Diffstat (limited to 'lib/libc/rpc/bindresvport.c')
-rw-r--r--lib/libc/rpc/bindresvport.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/libc/rpc/bindresvport.c b/lib/libc/rpc/bindresvport.c
index ae3b7883209..003de2778cf 100644
--- a/lib/libc/rpc/bindresvport.c
+++ b/lib/libc/rpc/bindresvport.c
@@ -28,7 +28,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: bindresvport.c,v 1.8 1996/08/19 08:31:24 tholo Exp $";
+static char *rcsid = "$OpenBSD: bindresvport.c,v 1.9 1996/09/15 09:31:30 tholo Exp $";
#endif /* LIBC_SCCS and not lint */
/*
@@ -57,8 +57,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;
@@ -79,7 +79,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;
@@ -92,8 +92,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)