diff options
author | imp <imp@FreeBSD.org> | 2002-02-02 06:48:10 +0000 |
---|---|---|
committer | imp <imp@FreeBSD.org> | 2002-02-02 06:48:10 +0000 |
commit | 50014e35418ca00d25ea852fc4f94acf80be4df3 (patch) | |
tree | f26db6e85c29b2244f601bdb366caa7f26a96c24 /bin/rcp/rcp.c | |
parent | 3fc8df52e3856eeac730574d5ae122806dd1e1ef (diff) | |
download | FreeBSD-src-50014e35418ca00d25ea852fc4f94acf80be4df3.zip FreeBSD-src-50014e35418ca00d25ea852fc4f94acf80be4df3.tar.gz |
o __P has been reoved
o Old-style K&R declarations have been converted to new C89 style
o register has been removed
o prototype for main() has been removed (gcc3 makes it an error)
o int main(int argc, char *argv[]) is the preferred main definition.
o Attempt to not break style(9) conformance for declarations more than
they already are.
Diffstat (limited to 'bin/rcp/rcp.c')
-rw-r--r-- | bin/rcp/rcp.c | 75 |
1 files changed, 19 insertions, 56 deletions
diff --git a/bin/rcp/rcp.c b/bin/rcp/rcp.c index 9b9db6e..3cc6ceb 100644 --- a/bin/rcp/rcp.c +++ b/bin/rcp/rcp.c @@ -106,22 +106,20 @@ static char **argv_copy; char cmd[CMDNEEDS]; /* must hold "rcp -r -p -d\0" */ #ifdef KERBEROS -int kerberos __P((char **, char *, char *, char *)); -void oldw __P((const char *, ...)) __printflike(1, 2); +int kerberos(char **, char *, char *, char *); +void oldw(const char *, ...) __printflike(1, 2); #endif -int response __P((void)); -void rsource __P((char *, struct stat *)); -void run_err __P((const char *, ...)) __printflike(1, 2); -void sink __P((int, char *[])); -void source __P((int, char *[])); -void tolocal __P((int, char *[])); -void toremote __P((char *, int, char *[])); -void usage __P((void)); +int response(void); +void rsource(char *, struct stat *); +void run_err(const char *, ...) __printflike(1, 2); +void sink(int, char *[]); +void source(int, char *[]); +void tolocal(int, char *[]); +void toremote(char *, int, char *[]); +void usage(void); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { struct servent *sp; int ch, fflag, i, tflag; @@ -269,9 +267,7 @@ main(argc, argv) } void -toremote(targ, argc, argv) - char *targ, *argv[]; - int argc; +toremote(char *targ, int argc, char *argv[]) { int i, len, tos; char *bp, *host, *src, *suser, *thost, *tuser; @@ -361,9 +357,7 @@ toremote(targ, argc, argv) } void -tolocal(argc, argv) - int argc; - char *argv[]; +tolocal(int argc, char *argv[]) { int i, len, tos; char *bp, *host, *src, *suser; @@ -425,9 +419,7 @@ tolocal(argc, argv) } void -source(argc, argv) - int argc; - char *argv[]; +source(int argc, char *argv[]) { struct stat stb; static BUF buffer; @@ -513,9 +505,7 @@ next: (void)close(fd); } void -rsource(name, statp) - char *name; - struct stat *statp; +rsource(char *name, struct stat *statp) { DIR *dirp; struct dirent *dp; @@ -566,9 +556,7 @@ rsource(name, statp) } void -sink(argc, argv) - int argc; - char *argv[]; +sink(int argc, char *argv[]) { static BUF buffer; struct stat stb; @@ -806,8 +794,7 @@ screwup: #ifdef KERBEROS int -kerberos(host, bp, locuser, user) - char **host, *bp, *locuser, *user; +kerberos(char **host, char *bp, char *locuser, char *user) { if (use_kerberos) { setuid(getuid()); @@ -844,7 +831,7 @@ kerberos(host, bp, locuser, user) #endif /* KERBEROS */ int -response() +response(void) { char ch, *cp, resp, rbuf[BUFSIZ]; @@ -877,7 +864,7 @@ response() } void -usage() +usage(void) { #ifdef KERBEROS #ifdef CRYPT @@ -897,28 +884,14 @@ usage() exit(1); } -#if __STDC__ #include <stdarg.h> -#else -#include <varargs.h> -#endif #ifdef KERBEROS void -#if __STDC__ oldw(const char *fmt, ...) -#else -oldw(fmt, va_alist) - char *fmt; - va_dcl -#endif { va_list ap; -#if __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif (void)fprintf(stderr, "rcp: "); (void)vfprintf(stderr, fmt, ap); (void)fprintf(stderr, ", using standard rcp\n"); @@ -927,21 +900,11 @@ oldw(fmt, va_alist) #endif void -#if __STDC__ run_err(const char *fmt, ...) -#else -run_err(fmt, va_alist) - char *fmt; - va_dcl -#endif { static FILE *fp; va_list ap; -#if __STDC__ va_start(ap, fmt); -#else - va_start(ap); -#endif ++errs; if (fp == NULL && !(fp = fdopen(rem, "w"))) |