diff options
author | tholo <> | 1996-09-15 09:31:53 +0000 |
---|---|---|
committer | tholo <> | 1996-09-15 09:31:53 +0000 |
commit | 27b62657a94b21845fcea14320c285cb5b1a2800 (patch) | |
tree | 947900ef381c1a838cf05f934ed5349615aac605 /src/lib/libc/net | |
parent | 5db356f3a7b6b461177c41660da527087e8d4399 (diff) | |
download | openbsd-27b62657a94b21845fcea14320c285cb5b1a2800.tar.gz openbsd-27b62657a94b21845fcea14320c285cb5b1a2800.tar.bz2 openbsd-27b62657a94b21845fcea14320c285cb5b1a2800.zip |
Remove dead code
Remove unused variables
Silence some warnings
lint(1) is your friend
Diffstat (limited to 'src/lib/libc/net')
-rw-r--r-- | src/lib/libc/net/rcmdsh.c | 14 | ||||
-rw-r--r-- | src/lib/libc/net/res_debug.c | 4 | ||||
-rw-r--r-- | src/lib/libc/net/res_init.c | 5 | ||||
-rw-r--r-- | src/lib/libc/net/res_mkquery.c | 5 |
4 files changed, 16 insertions, 12 deletions
diff --git a/src/lib/libc/net/rcmdsh.c b/src/lib/libc/net/rcmdsh.c index fe49a5a21b..39338c2c74 100644 --- a/src/lib/libc/net/rcmdsh.c +++ b/src/lib/libc/net/rcmdsh.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: rcmdsh.c,v 1.2 1996/09/01 20:28:22 millert Exp $ */ | 1 | /* $OpenBSD: rcmdsh.c,v 1.3 1996/09/15 09:31:17 tholo Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * This is an rcmd() replacement originally by | 4 | * This is an rcmd() replacement originally by |
@@ -6,7 +6,7 @@ | |||
6 | */ | 6 | */ |
7 | 7 | ||
8 | #if defined(LIBC_SCCS) && !defined(lint) | 8 | #if defined(LIBC_SCCS) && !defined(lint) |
9 | static char *rcsid = "$OpenBSD: rcmdsh.c,v 1.2 1996/09/01 20:28:22 millert Exp $"; | 9 | static char *rcsid = "$OpenBSD: rcmdsh.c,v 1.3 1996/09/15 09:31:17 tholo Exp $"; |
10 | #endif /* LIBC_SCCS and not lint */ | 10 | #endif /* LIBC_SCCS and not lint */ |
11 | 11 | ||
12 | #include <sys/types.h> | 12 | #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 $ | |||
19 | #include <string.h> | 19 | #include <string.h> |
20 | #include <pwd.h> | 20 | #include <pwd.h> |
21 | #include <paths.h> | 21 | #include <paths.h> |
22 | #include <unistd.h> | ||
22 | 23 | ||
23 | /* | 24 | /* |
24 | * This is a replacement rcmd() function that uses the rsh(1) | 25 | * This is a replacement rcmd() function that uses the rsh(1) |
25 | * program in place of a direct rcmd(3) function call so as to | 26 | * program in place of a direct rcmd(3) function call so as to |
26 | * avoid having to be root. Note that rport is ignored. | 27 | * avoid having to be root. Note that rport is ignored. |
27 | */ | 28 | */ |
29 | /* ARGSUSED */ | ||
28 | int | 30 | int |
29 | rcmdsh(ahost, rport, locuser, remuser, cmd, rshprog) | 31 | rcmdsh(ahost, rport, locuser, remuser, cmd, rshprog) |
30 | char **ahost; | 32 | char **ahost; |
31 | u_short rport; | 33 | int rport; |
32 | char *locuser, *remuser, *cmd; | 34 | const char *locuser, *remuser, *cmd; |
33 | char *rshprog; | 35 | char *rshprog; |
34 | { | 36 | { |
35 | struct hostent *hp; | 37 | struct hostent *hp; |
@@ -109,12 +111,12 @@ rcmdsh(ahost, rport, locuser, remuser, cmd, rshprog) | |||
109 | (void) fprintf(stderr, "rcmdsh: execlp %s failed: %s\n", | 111 | (void) fprintf(stderr, "rcmdsh: execlp %s failed: %s\n", |
110 | rshprog, strerror(errno)); | 112 | rshprog, strerror(errno)); |
111 | _exit(255); | 113 | _exit(255); |
112 | } else if (cpid > 0) { | 114 | } else { |
113 | /* Parent. close sp[1], return sp[0]. */ | 115 | /* Parent. close sp[1], return sp[0]. */ |
114 | (void) close(sp[1]); | 116 | (void) close(sp[1]); |
115 | /* Reap child. */ | 117 | /* Reap child. */ |
116 | (void) wait(NULL); | 118 | (void) wait(NULL); |
117 | return(sp[0]); | 119 | return(sp[0]); |
118 | } | 120 | } |
119 | /*NOTREACHED*/ | 121 | /* NOTREACHED */ |
120 | } | 122 | } |
diff --git a/src/lib/libc/net/res_debug.c b/src/lib/libc/net/res_debug.c index e8fc192c51..ae6c030a1f 100644 --- a/src/lib/libc/net/res_debug.c +++ b/src/lib/libc/net/res_debug.c | |||
@@ -52,7 +52,7 @@ | |||
52 | */ | 52 | */ |
53 | 53 | ||
54 | #if defined(LIBC_SCCS) && !defined(lint) | 54 | #if defined(LIBC_SCCS) && !defined(lint) |
55 | static char rcsid[] = "$OpenBSD: res_debug.c,v 1.3 1996/08/19 08:29:44 tholo Exp $"; | 55 | static char rcsid[] = "$OpenBSD: res_debug.c,v 1.4 1996/09/15 09:31:18 tholo Exp $"; |
56 | #endif /* LIBC_SCCS and not lint */ | 56 | #endif /* LIBC_SCCS and not lint */ |
57 | 57 | ||
58 | #include <sys/param.h> | 58 | #include <sys/param.h> |
@@ -601,7 +601,7 @@ __p_rr(cp, msg, file) | |||
601 | 601 | ||
602 | case T_UINFO: | 602 | case T_UINFO: |
603 | putc('\t', file); | 603 | putc('\t', file); |
604 | fputs(cp, file); | 604 | fputs((char *) cp, file); |
605 | cp += dlen; | 605 | cp += dlen; |
606 | break; | 606 | break; |
607 | 607 | ||
diff --git a/src/lib/libc/net/res_init.c b/src/lib/libc/net/res_init.c index cb60d4c0df..355c9ce1b0 100644 --- a/src/lib/libc/net/res_init.c +++ b/src/lib/libc/net/res_init.c | |||
@@ -52,7 +52,7 @@ | |||
52 | */ | 52 | */ |
53 | 53 | ||
54 | #if defined(LIBC_SCCS) && !defined(lint) | 54 | #if defined(LIBC_SCCS) && !defined(lint) |
55 | static char rcsid[] = "$OpenBSD: res_init.c,v 1.6 1996/08/27 03:32:53 deraadt Exp $"; | 55 | static char rcsid[] = "$OpenBSD: res_init.c,v 1.7 1996/09/15 09:31:19 tholo Exp $"; |
56 | #endif /* LIBC_SCCS and not lint */ | 56 | #endif /* LIBC_SCCS and not lint */ |
57 | 57 | ||
58 | #include <sys/param.h> | 58 | #include <sys/param.h> |
@@ -112,8 +112,6 @@ res_init() | |||
112 | int haveenv = 0; | 112 | int haveenv = 0; |
113 | int havesearch = 0; | 113 | int havesearch = 0; |
114 | int nsort = 0; | 114 | int nsort = 0; |
115 | int dots; | ||
116 | u_long mask; | ||
117 | 115 | ||
118 | _res.nsaddr.sin_len = sizeof(struct sockaddr_in); | 116 | _res.nsaddr.sin_len = sizeof(struct sockaddr_in); |
119 | _res.nsaddr.sin_family = AF_INET; | 117 | _res.nsaddr.sin_family = AF_INET; |
@@ -344,6 +342,7 @@ res_init() | |||
344 | return (0); | 342 | return (0); |
345 | } | 343 | } |
346 | 344 | ||
345 | /* ARGSUSED */ | ||
347 | static void | 346 | static void |
348 | res_setoptions(options, source) | 347 | res_setoptions(options, source) |
349 | char *options, *source; | 348 | char *options, *source; |
diff --git a/src/lib/libc/net/res_mkquery.c b/src/lib/libc/net/res_mkquery.c index 90ffb9966a..02b64e9886 100644 --- a/src/lib/libc/net/res_mkquery.c +++ b/src/lib/libc/net/res_mkquery.c | |||
@@ -52,7 +52,7 @@ | |||
52 | */ | 52 | */ |
53 | 53 | ||
54 | #if defined(LIBC_SCCS) && !defined(lint) | 54 | #if defined(LIBC_SCCS) && !defined(lint) |
55 | static char rcsid[] = "$OpenBSD: res_mkquery.c,v 1.3 1996/08/19 08:29:47 tholo Exp $"; | 55 | static char rcsid[] = "$OpenBSD: res_mkquery.c,v 1.4 1996/09/15 09:31:20 tholo Exp $"; |
56 | #endif /* LIBC_SCCS and not lint */ | 56 | #endif /* LIBC_SCCS and not lint */ |
57 | 57 | ||
58 | #include <sys/param.h> | 58 | #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 | |||
66 | * Form all types of queries. | 66 | * Form all types of queries. |
67 | * Returns the size of the result or -1. | 67 | * Returns the size of the result or -1. |
68 | */ | 68 | */ |
69 | /* ARGSUSED */ | ||
69 | int | 70 | int |
70 | res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen) | 71 | res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen) |
71 | int op; /* opcode of query */ | 72 | int op; /* opcode of query */ |
@@ -80,7 +81,9 @@ res_mkquery(op, dname, class, type, data, datalen, newrr_in, buf, buflen) | |||
80 | register HEADER *hp; | 81 | register HEADER *hp; |
81 | register u_char *cp; | 82 | register u_char *cp; |
82 | register int n; | 83 | register int n; |
84 | #ifdef ALLOW_UPDATES | ||
83 | struct rrec *newrr = (struct rrec *) newrr_in; | 85 | struct rrec *newrr = (struct rrec *) newrr_in; |
86 | #endif /* ALLOW_UPDATES */ | ||
84 | u_char *dnptrs[10], **dpp, **lastdnptr; | 87 | u_char *dnptrs[10], **dpp, **lastdnptr; |
85 | 88 | ||
86 | #ifdef DEBUG | 89 | #ifdef DEBUG |