summaryrefslogtreecommitdiffstats
path: root/bin/rcp
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2002-02-02 06:48:10 +0000
committerimp <imp@FreeBSD.org>2002-02-02 06:48:10 +0000
commit50014e35418ca00d25ea852fc4f94acf80be4df3 (patch)
treef26db6e85c29b2244f601bdb366caa7f26a96c24 /bin/rcp
parent3fc8df52e3856eeac730574d5ae122806dd1e1ef (diff)
downloadFreeBSD-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')
-rw-r--r--bin/rcp/extern.h16
-rw-r--r--bin/rcp/rcp.c75
-rw-r--r--bin/rcp/util.c20
3 files changed, 33 insertions, 78 deletions
diff --git a/bin/rcp/extern.h b/bin/rcp/extern.h
index 06e639b..a07c3a6 100644
--- a/bin/rcp/extern.h
+++ b/bin/rcp/extern.h
@@ -41,11 +41,11 @@ typedef struct {
extern int iamremote;
-BUF *allocbuf __P((BUF *, int, int));
-char *colon __P((char *));
-void lostconn __P((int));
-void nospace __P((void));
-int okname __P((char *));
-void run_err __P((const char *, ...)) __printflike(1, 2);
-int susystem __P((char *, int));
-void verifydir __P((char *));
+BUF *allocbuf(BUF *, int, int);
+char *colon(char *);
+void lostconn(int);
+void nospace(void);
+int okname(char *);
+void run_err(const char *, ...) __printflike(1, 2);
+int susystem(char *, int);
+void verifydir(char *);
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")))
diff --git a/bin/rcp/util.c b/bin/rcp/util.c
index 6e82007..4174589 100644
--- a/bin/rcp/util.c
+++ b/bin/rcp/util.c
@@ -56,8 +56,7 @@ static const char rcsid[] =
#include "extern.h"
char *
-colon(cp)
- char *cp;
+colon(char *cp)
{
if (*cp == ':') /* Leading colon is part of file name. */
return (0);
@@ -72,8 +71,7 @@ colon(cp)
}
void
-verifydir(cp)
- char *cp;
+verifydir(char *cp)
{
struct stat stb;
@@ -87,8 +85,7 @@ verifydir(cp)
}
int
-okname(cp0)
- char *cp0;
+okname(char *cp0)
{
int c;
char *cp;
@@ -108,9 +105,7 @@ bad: warnx("%s: invalid user name", cp0);
}
int
-susystem(s, userid)
- int userid;
- char *s;
+susystem(char *s, int userid)
{
sig_t istat, qstat;
int status;
@@ -136,9 +131,7 @@ susystem(s, userid)
}
BUF *
-allocbuf(bp, fd, blksize)
- BUF *bp;
- int fd, blksize;
+allocbuf(BUF *bp, int fd, int blksize)
{
struct stat stb;
size_t size;
@@ -162,8 +155,7 @@ allocbuf(bp, fd, blksize)
}
void
-lostconn(signo)
- int signo;
+lostconn(int signo)
{
if (!iamremote)
warnx("lost connection");
OpenPOWER on IntegriCloud