Remove #ifdef __STDC__. De-__P() and ANSIfy.

This commit is contained in:
wiz 2002-06-14 00:51:04 +00:00
parent 2f40c45705
commit 4cdb6cf0d7

View File

@ -1,4 +1,4 @@
/* $NetBSD: rsh.c,v 1.14 2001/02/19 23:03:51 cgd Exp $ */ /* $NetBSD: rsh.c,v 1.15 2002/06/14 00:51:04 wiz Exp $ */
/*- /*-
* Copyright (c) 1983, 1990, 1993, 1994 * Copyright (c) 1983, 1990, 1993, 1994
@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1983, 1990, 1993, 1994\n\
#if 0 #if 0
static char sccsid[] = "@(#)rsh.c 8.4 (Berkeley) 4/29/95"; static char sccsid[] = "@(#)rsh.c 8.4 (Berkeley) 4/29/95";
#else #else
__RCSID("$NetBSD: rsh.c,v 1.14 2001/02/19 23:03:51 cgd Exp $"); __RCSID("$NetBSD: rsh.c,v 1.15 2002/06/14 00:51:04 wiz Exp $");
#endif #endif
#endif /* not lint */ #endif /* not lint */
@ -60,15 +60,11 @@ __RCSID("$NetBSD: rsh.c,v 1.14 2001/02/19 23:03:51 cgd Exp $");
#include <errno.h> #include <errno.h>
#include <pwd.h> #include <pwd.h>
#include <signal.h> #include <signal.h>
#include <stdarg.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include <unistd.h> #include <unistd.h>
#ifdef __STDC__
#include <stdarg.h>
#else
#include <varargs.h>
#endif
#include "pathnames.h" #include "pathnames.h"
@ -81,7 +77,7 @@ Key_schedule schedule;
int use_kerberos = 1, doencrypt; int use_kerberos = 1, doencrypt;
char dst_realm_buf[REALM_SZ], *dest_realm; char dst_realm_buf[REALM_SZ], *dest_realm;
void warning __P((const char *, ...)); void warning(const char *, ...);
#endif #endif
/* /*
@ -91,23 +87,21 @@ int remerr;
static int sigs[] = { SIGINT, SIGTERM, SIGQUIT }; static int sigs[] = { SIGINT, SIGTERM, SIGQUIT };
char *copyargs __P((char **)); char *copyargs(char **);
void sendsig __P((int)); void sendsig(int);
int checkfd __P((struct pollfd *, int)); int checkfd(struct pollfd *, int);
void talk __P((int, sigset_t *, pid_t, int)); void talk(int, sigset_t *, pid_t, int);
void usage __P((void)); void usage(void);
int main __P((int, char **)); int main(int, char **);
#ifdef IN_RCMD #ifdef IN_RCMD
int orcmd __P((char **, int, const char *, int orcmd(char **, int, const char *,
const char *, const char *, int *)); const char *, const char *, int *);
int orcmd_af __P((char **, int, const char *, int orcmd_af(char **, int, const char *,
const char *, const char *, int *, int)); const char *, const char *, int *, int);
#endif #endif
int int
main(argc, argv) main(int argc, char **argv)
int argc;
char **argv;
{ {
struct passwd *pw; struct passwd *pw;
struct servent *sp; struct servent *sp;
@ -400,9 +394,7 @@ try_connect:
} }
int int
checkfd(fdp, outfd) checkfd(struct pollfd *fdp, int outfd)
struct pollfd *fdp;
int outfd;
{ {
int nr, nw; int nr, nw;
char buf[BUFSIZ]; char buf[BUFSIZ];
@ -440,11 +432,7 @@ checkfd(fdp, outfd)
} }
void void
talk(nflag, oset, pid, rem) talk(int nflag, sigset_t *oset, __pid_t pid, int rem)
int nflag;
sigset_t *oset;
pid_t pid;
int rem;
{ {
int nr, nw, nfds; int nr, nw, nfds;
struct pollfd fds[2], *fdp = &fds[0]; struct pollfd fds[2], *fdp = &fds[0];
@ -533,8 +521,7 @@ done:
} }
void void
sendsig(sig) sendsig(int sig)
int sig;
{ {
char signo; char signo;
@ -552,23 +539,11 @@ sendsig(sig)
#ifdef KERBEROS #ifdef KERBEROS
/* VARARGS */ /* VARARGS */
void void
#ifdef __STDC__
warning(const char *fmt, ...) warning(const char *fmt, ...)
#else
warning(va_alist)
va_dcl
#endif
{ {
va_list ap; va_list ap;
#ifndef __STDC__
const char *fmt;
va_start(ap);
fmt = va_arg(ap, const char *);
#else
va_start(ap, fmt); va_start(ap, fmt);
#endif
(void) fprintf(stderr, "%s: warning, using standard rsh: ", (void) fprintf(stderr, "%s: warning, using standard rsh: ",
getprogname()); getprogname());
(void) vfprintf(stderr, fmt, ap); (void) vfprintf(stderr, fmt, ap);
@ -578,8 +553,7 @@ warning(va_alist)
#endif #endif
char * char *
copyargs(argv) copyargs(char **argv)
char **argv;
{ {
int cc; int cc;
char **ap, *args, *p; char **ap, *args, *p;
@ -600,7 +574,7 @@ copyargs(argv)
} }
void void
usage() usage(void)
{ {
(void)fprintf(stderr, (void)fprintf(stderr,