summaryrefslogtreecommitdiffstats
path: root/lib/libc/net/rcmdsh.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/net/rcmdsh.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/net/rcmdsh.c')
-rw-r--r--lib/libc/net/rcmdsh.c14
1 files changed, 8 insertions, 6 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 */
}