diff options
author | 1996-09-15 09:30:42 +0000 | |
---|---|---|
committer | 1996-09-15 09:30:42 +0000 | |
commit | c8f91e0d750eb1dd5aa79a93a20a522c47067c28 (patch) | |
tree | 151e2a572b80f59c243874a0738c218470cf1bc0 /lib/libc/net | |
parent | print debugging flags in usage(); idea from freebsd (diff) | |
download | wireguard-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/net')
-rw-r--r-- | lib/libc/net/rcmdsh.c | 14 | ||||
-rw-r--r-- | lib/libc/net/res_debug.c | 4 | ||||
-rw-r--r-- | lib/libc/net/res_init.c | 5 | ||||
-rw-r--r-- | lib/libc/net/res_mkquery.c | 5 |
4 files changed, 16 insertions, 12 deletions
diff --git a/lib/libc/net/rcmdsh.c b/lib/libc/net/rcmdsh.c index fe49a5a21bb..39338c2c744 100644 --- a/lib/libc/net/rcmdsh.c +++ b/lib/libc/net/rcmdsh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rcmdsh.c,v 1.2 1996/09/01 20:28:22 millert Exp $ */ +/* $OpenBSD: rcmdsh.c,v 1.3 1996/09/15 09:31:17 tholo Exp $ */ /* * This is an rcmd() replacement originally by @@ -6,7 +6,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: rcmdsh.c,v 1.2 1996/09/01 20:28:22 millert Exp $"; +static char *rcsid = "$OpenBSD: rcmdsh.c,v 1.3 1996/09/15 09:31:17 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -19,17 +19,19 @@ static char *rcsid = "$OpenBSD: rcmdsh.c,v 1.2 1996/09/01 20:28:22 millert Exp $ #include <string.h> #include <pwd.h> #include <paths.h> +#include <unistd.h> /* * This is a replacement rcmd() function that uses the rsh(1) * program in place of a direct rcmd(3) function call so as to * avoid having to be root. Note that rport is ignored. */ +/* ARGSUSED */ int rcmdsh(ahost, rport, locuser, remuser, cmd, rshprog) char **ahost; - u_short rport; - char *locuser, *remuser, *cmd; + int rport; + const char *locuser, *remuser, *cmd; char *rshprog; { struct hostent *hp; @@ -109,12 +111,12 @@ rcmdsh(ahost, rport, locuser, remuser, cmd, rshprog) (void) fprintf(stderr, "rcmdsh: execlp %s failed: %s\n", rshprog, strerror(errno)); _exit(255); - } else if (cpid > 0) { + } else { /* Parent. close sp[1], return sp[0]. */ (void) close(sp[1]); /* Reap child. */ (void) wait(NULL); return(sp[0]); } - /*NOTREACHED*/ + /* NOTREACHED */ } diff --git a/lib/libc/net/res_debug.c b/lib/libc/net/res_debug.c index e8fc192c512..ae6c030a1f0 100644 --- a/lib/libc/net/res_debug.c +++ b/lib/libc/net/res_debug.c @@ -52,7 +52,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: res_debug.c,v 1.3 1996/08/19 08:29:44 tholo Exp $"; +static char rcsid[] = "$OpenBSD: res_debug.c,v 1.4 1996/09/15 09:31:18 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -601,7 +601,7 @@ __p_rr(cp, msg, file) case T_UINFO: putc('\t', file); - fputs(cp, file); + fputs((char *) cp, file); cp += dlen; break; diff --git a/lib/libc/net/res_init.c b/lib/libc/net/res_init.c index cb60d4c0df1..355c9ce1b0f 100644 --- a/lib/libc/net/res_init.c +++ b/lib/libc/net/res_init.c @@ -52,7 +52,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: res_init.c,v 1.6 1996/08/27 03:32:53 deraadt Exp $"; +static char rcsid[] = "$OpenBSD: res_init.c,v 1.7 1996/09/15 09:31:19 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -112,8 +112,6 @@ res_init() int haveenv = 0; int havesearch = 0; int nsort = 0; - int dots; - u_long mask; _res.nsaddr.sin_len = sizeof(struct sockaddr_in); _res.nsaddr.sin_family = AF_INET; @@ -344,6 +342,7 @@ res_init() return (0); } +/* ARGSUSED */ static void res_setoptions(options, source) char *options, *source; diff --git a/lib/libc/net/res_mkquery.c b/lib/libc/net/res_mkquery.c index 90ffb9966a8..02b64e98865 100644 --- a/lib/libc/net/res_mkquery.c +++ b/lib/libc/net/res_mkquery.c @@ -52,7 +52,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char rcsid[] = "$OpenBSD: res_mkquery.c,v 1.3 1996/08/19 08:29:47 tholo Exp $"; +static char rcsid[] = "$OpenBSD: res_mkquery.c,v 1.4 1996/09/15 09:31:20 tholo Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -66,6 +66,7 @@ static char rcsid[] = "$OpenBSD: res_mkquery.c,v 1.3 1996/08/19 08:29:47 tholo E * Form all types of queries. * Returns the size of the result or -1. */ +/* ARGSUSED */ int res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen) int op; /* opcode of query */ @@ -80,7 +81,9 @@ res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen) register HEADER *hp; register u_char *cp; register int n; +#ifdef ALLOW_UPDATES struct rrec *newrr = (struct rrec *) newrr_in; +#endif /* ALLOW_UPDATES */ u_char *dnptrs[10], **dpp, **lastdnptr; #ifdef DEBUG |