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/rcmdsh.c | |
| 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/rcmdsh.c')
| -rw-r--r-- | src/lib/libc/net/rcmdsh.c | 14 | 
1 files changed, 8 insertions, 6 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 | } | 
