summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2003-06-26 16:35:22 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2003-06-26 16:35:22 +0000
commit0e078284c228e4e0347a385ebeb7d9c7ff51ca5b (patch)
tree6483a3a95bad324adbd937ee8bd32d9ff6924dfa
parent849dc8da17a4b089f646b5d4941314d0ec3c6e73 (diff)
ansi and protos
-rw-r--r--lib/libutil/passwd.c69
-rw-r--r--sbin/dump/dumprmt.c56
-rw-r--r--sbin/dump/itime.c25
-rw-r--r--sbin/dump/main.c22
-rw-r--r--sbin/dump/optr.c33
-rw-r--r--sbin/dump/tape.c76
-rw-r--r--sbin/dump/traverse.c59
-rw-r--r--sbin/route/ccitt_addr.c6
-rw-r--r--sbin/route/route.c19
-rw-r--r--sbin/route/show.c8
10 files changed, 132 insertions, 241 deletions
diff --git a/lib/libutil/passwd.c b/lib/libutil/passwd.c
index db10cf77c28..33b900db5c0 100644
--- a/lib/libutil/passwd.c
+++ b/lib/libutil/passwd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: passwd.c,v 1.41 2003/06/02 20:18:42 millert Exp $ */
+/* $OpenBSD: passwd.c,v 1.42 2003/06/26 16:34:42 deraadt Exp $ */
/*
* Copyright (c) 1987, 1993, 1994, 1995
@@ -30,7 +30,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static const char rcsid[] = "$OpenBSD: passwd.c,v 1.41 2003/06/02 20:18:42 millert Exp $";
+static const char rcsid[] = "$OpenBSD: passwd.c,v 1.42 2003/06/26 16:34:42 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/types.h>
@@ -58,8 +58,7 @@ static const char rcsid[] = "$OpenBSD: passwd.c,v 1.41 2003/06/02 20:18:42 mille
static void pw_cont(int sig);
-static const char options[NUM_OPTIONS][2][80] =
-{
+static const char options[NUM_OPTIONS][2][80] = {
{"localcipher", "blowfish,4"},
{"ypcipher", "old"}
};
@@ -68,10 +67,13 @@ static char pw_defdir[] = "/etc";
static char *pw_dir = pw_defdir;
static char *pw_lck;
+static void trim_whitespace(char *);
+static int read_line(FILE *, char *, int);
+static const char *pw_default(const char *);
+
/* Removes head and/or tail spaces. */
static void
-trim_whitespace(line)
- char *line;
+trim_whitespace(char *line)
{
char *p;
@@ -91,10 +93,7 @@ trim_whitespace(line)
/* Get one line, remove spaces from front and tail */
static int
-read_line(fp, line, max)
- FILE *fp;
- char *line;
- int max;
+read_line(FILE *fp, char *line, int max)
{
char *p;
@@ -117,8 +116,7 @@ read_line(fp, line, max)
static const char *
-pw_default(option)
- char *option;
+pw_default(const char *option)
{
int i;
@@ -129,8 +127,7 @@ pw_default(option)
}
char *
-pw_file(nm)
- const char *nm;
+pw_file(const char *nm)
{
const char *p = strrchr(nm, '/');
char *new_nm;
@@ -153,11 +150,7 @@ pw_file(nm)
* well.
*/
void
-pw_getconf(data, max, key, option)
- char *data;
- size_t max;
- const char *key;
- const char *option;
+pw_getconf(char *data, size_t max, const char *key, const char *option)
{
FILE *fp;
char line[LINE_MAX];
@@ -225,8 +218,7 @@ pw_getconf(data, max, key, option)
void
-pw_setdir(dir)
- const char *dir;
+pw_setdir(const char *dir)
{
char *p;
@@ -244,8 +236,7 @@ pw_setdir(dir)
int
-pw_lock(retries)
- int retries;
+pw_lock(int retries)
{
int i, fd;
mode_t old_mode;
@@ -271,9 +262,7 @@ pw_lock(retries)
}
int
-pw_mkdb(username, flags)
- char *username;
- int flags;
+pw_mkdb(char *username, int flags)
{
int pstat, ac;
pid_t pid;
@@ -319,7 +308,7 @@ pw_mkdb(username, flags)
}
int
-pw_abort()
+pw_abort(void)
{
return (pw_lck ? unlink(pw_lck) : -1);
}
@@ -331,18 +320,17 @@ pw_abort()
static pid_t editpid = -1;
static void
-pw_cont(sig)
- int sig;
+pw_cont(int signo)
{
int save_errno = errno;
if (editpid != -1)
- kill(editpid, sig);
+ kill(editpid, signo);
errno = save_errno;
}
void
-pw_init()
+pw_init(void)
{
struct rlimit rlim;
@@ -372,9 +360,7 @@ pw_init()
}
void
-pw_edit(notsetuid, filename)
- int notsetuid;
- const char *filename;
+pw_edit(int notsetuid, const char *filename)
{
int pstat;
char *p;
@@ -423,7 +409,7 @@ pw_edit(notsetuid, filename)
}
void
-pw_prompt()
+pw_prompt(void)
{
int first, c;
@@ -437,9 +423,7 @@ pw_prompt()
}
void
-pw_copy(ffd, tfd, pw)
- int ffd, tfd;
- struct passwd *pw;
+pw_copy(int ffd, int tfd, struct passwd *pw)
{
FILE *from, *to;
int done;
@@ -499,10 +483,7 @@ err:
}
int
-pw_scan(bp, pw, flags)
- char *bp;
- struct passwd *pw;
- int *flags;
+pw_scan(char *bp, struct passwd *pw, int *flags)
{
u_long id;
int root;
@@ -593,9 +574,7 @@ fmt: warnx("corrupted entry");
}
__dead void
-pw_error(name, err, eval)
- const char *name;
- int err, eval;
+pw_error(const char *name, int err, int eval)
{
char *master = pw_file(_PATH_MASTERPASSWD);
diff --git a/sbin/dump/dumprmt.c b/sbin/dump/dumprmt.c
index 89a61fa919a..aa83958f659 100644
--- a/sbin/dump/dumprmt.c
+++ b/sbin/dump/dumprmt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: dumprmt.c,v 1.20 2003/06/02 20:06:14 millert Exp $ */
+/* $OpenBSD: dumprmt.c,v 1.21 2003/06/26 16:35:21 deraadt Exp $ */
/* $NetBSD: dumprmt.c,v 1.17 1997/06/05 16:10:47 mrg Exp $ */
/*-
@@ -88,8 +88,7 @@ static int rmtreply(char *);
extern int ntrec; /* blocking factor on tape */
int
-rmthost(host)
- char *host;
+rmthost(char *host)
{
int len = strlen(host) + 1;
@@ -106,15 +105,14 @@ rmthost(host)
}
static void
-rmtconnaborted(signo)
- int signo;
+rmtconnaborted(int signo)
{
/* XXX signal race */
errx(X_ABORT, "Lost connection to remote host.");
}
void
-rmtgetconn()
+rmtgetconn(void)
{
char *cp;
static struct servent *sp = NULL;
@@ -166,8 +164,7 @@ rmtgetconn()
}
static int
-okname(cp0)
- char *cp0;
+okname(char *cp0)
{
char *cp;
int c;
@@ -183,9 +180,7 @@ okname(cp0)
}
int
-rmtopen(tape, mode)
- char *tape;
- int mode;
+rmtopen(char *tape, int mode)
{
char buf[256];
@@ -195,7 +190,7 @@ rmtopen(tape, mode)
}
void
-rmtclose()
+rmtclose(void)
{
if (rmtstate != TS_OPEN)
@@ -205,9 +200,7 @@ rmtclose()
}
int
-rmtread(buf, count)
- char *buf;
- int count;
+rmtread(char *buf, int count)
{
char line[30];
int n, i, cc;
@@ -228,9 +221,7 @@ rmtread(buf, count)
}
int
-rmtwrite(buf, count)
- char *buf;
- int count;
+rmtwrite(char *buf, int count)
{
char line[30];
@@ -241,8 +232,7 @@ rmtwrite(buf, count)
}
void
-rmtwrite0(count)
- int count;
+rmtwrite0(int count)
{
char line[30];
@@ -251,24 +241,21 @@ rmtwrite0(count)
}
void
-rmtwrite1(buf, count)
- char *buf;
- int count;
+rmtwrite1(char *buf, int count)
{
write(rmtape, buf, count);
}
int
-rmtwrite2()
+rmtwrite2(void)
{
return (rmtreply("write"));
}
int
-rmtseek(offset, pos)
- int offset, pos;
+rmtseek(int offset, int pos)
{
char line[80];
@@ -279,7 +266,7 @@ rmtseek(offset, pos)
struct mtget mts;
struct mtget *
-rmtstatus()
+rmtstatus(void)
{
int i;
char *cp;
@@ -293,8 +280,7 @@ rmtstatus()
}
int
-rmtioctl(cmd, count)
- int cmd, count;
+rmtioctl(int cmd, int count)
{
char buf[256];
@@ -305,8 +291,7 @@ rmtioctl(cmd, count)
}
static int
-rmtcall(cmd, buf)
- char *cmd, *buf;
+rmtcall(char *cmd, char *buf)
{
if (write(rmtape, buf, strlen(buf)) != strlen(buf))
@@ -315,8 +300,7 @@ rmtcall(cmd, buf)
}
static int
-rmtreply(cmd)
- char *cmd;
+rmtreply(char *cmd)
{
char *cp;
char code[30], emsg[BUFSIZ];
@@ -344,7 +328,7 @@ rmtreply(cmd)
}
int
-rmtgetb()
+rmtgetb(void)
{
char c;
@@ -355,9 +339,7 @@ rmtgetb()
/* Get a line (guaranteed to have a trailing newline). */
void
-rmtgets(line, len)
- char *line;
- int len;
+rmtgets(char *line, int len)
{
char *cp = line;
diff --git a/sbin/dump/itime.c b/sbin/dump/itime.c
index b19c28ffd8c..e19246dd919 100644
--- a/sbin/dump/itime.c
+++ b/sbin/dump/itime.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: itime.c,v 1.9 2003/06/02 20:06:14 millert Exp $ */
+/* $OpenBSD: itime.c,v 1.10 2003/06/26 16:35:21 deraadt Exp $ */
/* $NetBSD: itime.c,v 1.4 1997/04/15 01:09:50 lukem Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)itime.c 8.1 (Berkeley) 6/5/93";
#else
-static char rcsid[] = "$OpenBSD: itime.c,v 1.9 2003/06/02 20:06:14 millert Exp $";
+static char rcsid[] = "$OpenBSD: itime.c,v 1.10 2003/06/26 16:35:21 deraadt Exp $";
#endif
#endif /* not lint */
@@ -73,7 +73,7 @@ static int makedumpdate(struct dumpdates *, char *);
static void readdumptimes(FILE *);
void
-initdumptimes()
+initdumptimes(void)
{
FILE *df;
@@ -105,8 +105,7 @@ initdumptimes()
}
static void
-readdumptimes(df)
- FILE *df;
+readdumptimes(FILE *df)
{
int i;
struct dumptime *dtwalk;
@@ -133,7 +132,7 @@ readdumptimes(df)
}
void
-getdumptime()
+getdumptime(void)
{
struct dumpdates *ddp;
int i;
@@ -165,7 +164,7 @@ getdumptime()
}
void
-putdumptime()
+putdumptime(void)
{
FILE *df;
struct dumpdates *dtwalk;
@@ -222,9 +221,7 @@ putdumptime()
}
static void
-dumprecout(file, what)
- FILE *file;
- struct dumpdates *what;
+dumprecout(FILE *file, struct dumpdates *what)
{
if (fprintf(file, DUMPOUTFMT,
@@ -237,9 +234,7 @@ dumprecout(file, what)
int recno;
static int
-getrecord(df, ddatep)
- FILE *df;
- struct dumpdates *ddatep;
+getrecord(FILE *df, struct dumpdates *ddatep)
{
char tbuf[BUFSIZ];
@@ -259,9 +254,7 @@ getrecord(df, ddatep)
}
static int
-makedumpdate(ddp, tbuf)
- struct dumpdates *ddp;
- char *tbuf;
+makedumpdate(struct dumpdates *ddp, char *tbuf)
{
char un_buf[BUFSIZ], *str;
struct tm then;
diff --git a/sbin/dump/main.c b/sbin/dump/main.c
index e1841206ee1..b648f6d24d5 100644
--- a/sbin/dump/main.c
+++ b/sbin/dump/main.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: main.c,v 1.33 2003/06/02 20:06:14 millert Exp $ */
+/* $OpenBSD: main.c,v 1.34 2003/06/26 16:35:21 deraadt Exp $ */
/* $NetBSD: main.c,v 1.14 1997/06/05 11:13:24 lukem Exp $ */
/*-
@@ -96,9 +96,7 @@ static void obsolete(int *, char **[]);
static void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
ino_t ino;
int dirty;
@@ -556,7 +554,7 @@ main(argc, argv)
}
static void
-usage()
+usage(void)
{
extern char *__progname;
@@ -572,9 +570,7 @@ usage()
* range (except that a vmax of 0 means unlimited).
*/
static long
-numarg(meaning, vmin, vmax)
- char *meaning;
- long vmin, vmax;
+numarg(char *meaning, long vmin, long vmax)
{
char *p;
long val;
@@ -588,8 +584,7 @@ numarg(meaning, vmin, vmax)
}
void
-sig(signo)
- int signo;
+sig(int signo)
{
switch(signo) {
case SIGALRM:
@@ -615,8 +610,7 @@ sig(signo)
}
char *
-rawname(cp)
- char *cp;
+rawname(char *cp)
{
static char rawbuf[MAXPATHLEN];
char *dp = strrchr(cp, '/');
@@ -635,9 +629,7 @@ rawname(cp)
* getopt(3) will like.
*/
static void
-obsolete(argcp, argvp)
- int *argcp;
- char **argvp[];
+obsolete(int *argcp, char **argvp[])
{
int argc, flags;
char *ap, **argv, *flagsp, **nargv, *p;
diff --git a/sbin/dump/optr.c b/sbin/dump/optr.c
index 815645d8856..9e63d2b1583 100644
--- a/sbin/dump/optr.c
+++ b/sbin/dump/optr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: optr.c,v 1.23 2003/06/02 20:06:14 millert Exp $ */
+/* $OpenBSD: optr.c,v 1.24 2003/06/26 16:35:21 deraadt Exp $ */
/* $NetBSD: optr.c,v 1.11 1997/05/27 08:34:36 mrg Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)optr.c 8.2 (Berkeley) 1/6/94";
#else
-static char rcsid[] = "$OpenBSD: optr.c,v 1.23 2003/06/02 20:06:14 millert Exp $";
+static char rcsid[] = "$OpenBSD: optr.c,v 1.24 2003/06/26 16:35:21 deraadt Exp $";
#endif
#endif /* not lint */
@@ -75,8 +75,7 @@ static int timeout;
static char *attnmessage; /* attention message */
int
-query(question)
- char *question;
+query(char *question)
{
char replybuffer[64];
int back, errcount;
@@ -134,8 +133,7 @@ char lastmsg[BUFSIZ];
* XXX not safe
*/
void
-alarmcatch(signo)
- int signo;
+alarmcatch(int signo)
{
int save_errno = errno;
@@ -164,8 +162,7 @@ alarmcatch(signo)
* Here if an inquisitive operator interrupts the dump program
*/
void
-interrupt(signo)
- int signo;
+interrupt(int signo)
{
msg("Interrupt received.\n");
if (query("Do you want to abort dump?"))
@@ -176,8 +173,7 @@ interrupt(signo)
* We now use wall(1) to do the actual broadcasting.
*/
void
-broadcast(message)
- char *message;
+broadcast(char *message)
{
FILE *fp;
char buf[sizeof(_PATH_WALL) + sizeof(OPGRENT) + 3];
@@ -205,7 +201,7 @@ broadcast(message)
time_t tschedule = 0;
void
-timeest()
+timeest(void)
{
time_t tnow, deltat;
@@ -275,8 +271,7 @@ quit(const char *fmt, ...)
*/
struct fstab *
-allocfsent(fs)
- struct fstab *fs;
+allocfsent(struct fstab *fs)
{
struct fstab *new;
@@ -299,7 +294,7 @@ struct pfstab {
static struct pfstab *table;
void
-getfstab()
+getfstab(void)
{
struct fstab *fs;
struct pfstab *pf;
@@ -339,8 +334,7 @@ getfstab()
* The file name can omit the leading '/'.
*/
struct fstab *
-fstabsearch(key)
- char *key;
+fstabsearch(char *key)
{
struct pfstab *pf;
struct fstab *fs;
@@ -368,10 +362,10 @@ fstabsearch(key)
/*
* Tell the operator what to do
+ * w ==> just what to do; W ==> most recent dumps
*/
void
-lastdump(arg)
- char arg; /* w ==> just what to do; W ==> most recent dumps */
+lastdump(int arg)
{
int i;
struct fstab *dt;
@@ -413,8 +407,7 @@ lastdump(arg)
}
int
-datesort(a1, a2)
- const void *a1, *a2;
+datesort(const void *a1, const void *a2)
{
struct dumpdates *d1 = *(struct dumpdates **)a1;
struct dumpdates *d2 = *(struct dumpdates **)a2;
diff --git a/sbin/dump/tape.c b/sbin/dump/tape.c
index ec79a8aec8a..110a1d80cf9 100644
--- a/sbin/dump/tape.c
+++ b/sbin/dump/tape.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tape.c,v 1.16 2003/06/02 20:06:14 millert Exp $ */
+/* $OpenBSD: tape.c,v 1.17 2003/06/26 16:35:21 deraadt Exp $ */
/* $NetBSD: tape.c,v 1.11 1997/06/05 11:13:26 lukem Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)tape.c 8.2 (Berkeley) 3/17/94";
#else
-static char rcsid[] = "$OpenBSD: tape.c,v 1.16 2003/06/02 20:06:14 millert Exp $";
+static char rcsid[] = "$OpenBSD: tape.c,v 1.17 2003/06/26 16:35:21 deraadt Exp $";
#endif
#endif /* not lint */
@@ -77,7 +77,7 @@ extern int cartridge;
extern char *host;
char *nexttape;
-static ssize_t atomic(ssize_t (*)(), int, char *, int);
+static ssize_t atomic(ssize_t (*)(int, void *, size_t), int, char *, int);
static void doslave(int, int);
static void enslave(void);
static void flushtape(void);
@@ -127,7 +127,7 @@ static jmp_buf jmpbuf; /* where to jump to if we are ready when the */
/* SIGUSR2 arrives from the previous slave */
int
-alloctape()
+alloctape(void)
{
int pgoff = getpagesize() - 1;
char *buf;
@@ -167,9 +167,7 @@ alloctape()
}
void
-writerec(dp, isspcl)
- char *dp;
- int isspcl;
+writerec(char *dp, int isspcl)
{
slp->req[trecno].dblk = (daddr_t)0;
@@ -184,9 +182,7 @@ writerec(dp, isspcl)
}
void
-dumpblock(blkno, size)
- daddr_t blkno;
- int size;
+dumpblock(daddr_t blkno, int size)
{
int avail, tpblks, dblkno;
@@ -207,8 +203,7 @@ dumpblock(blkno, size)
int nogripe = 0;
void
-tperror(signo)
- int signo;
+tperror(int signo)
{
if (pipeout) {
@@ -229,8 +224,7 @@ tperror(signo)
}
void
-sigpipe(signo)
- int signo;
+sigpipe(int signo)
{
quit("Broken pipe\n");
@@ -241,7 +235,7 @@ sigpipe(signo)
* Update xferrate stats
*/
time_t
-do_stats()
+do_stats(void)
{
time_t tnow, ttaken;
int blocks;
@@ -267,8 +261,7 @@ do_stats()
* XXX not safe
*/
void
-statussig(notused)
- int notused;
+statussig(int notused)
{
time_t tnow, deltat;
char msgbuf[128];
@@ -289,7 +282,7 @@ statussig(notused)
}
static void
-flushtape()
+flushtape(void)
{
int i, blks, got;
long lastfirstrec;
@@ -298,7 +291,8 @@ flushtape()
slp->req[trecno].count = 0; /* Sentinel */
- if (atomic(write, slp->fd, (char *)slp->req, siz) != siz)
+ if (atomic((ssize_t (*)(int, void *, size_t))write, slp->fd,
+ (char *)slp->req, siz) != siz)
quit("error writing command pipe: %s\n", strerror(errno));
slp->sent = 1; /* we sent a request, read the response later */
@@ -366,7 +360,7 @@ flushtape()
}
void
-trewind()
+trewind(void)
{
int f;
int got;
@@ -419,7 +413,7 @@ trewind()
}
void
-close_rewind()
+close_rewind(void)
{
time_t tstart_changevol, tend_changevol;
@@ -442,7 +436,7 @@ close_rewind()
}
void
-rollforward()
+rollforward(void)
{
struct req *p, *q, *prev;
struct slave *tslp;
@@ -494,7 +488,8 @@ rollforward()
lastspclrec = savedtapea - 1;
}
size = (char *)ntb - (char *)q;
- if (atomic(write, slp->fd, (char *)q, size) != size) {
+ if (atomic((ssize_t (*)(int, void *, size_t))write,
+ slp->fd, (char *)q, size) != size) {
perror(" DUMP: error writing command pipe");
dumpabort(0);
}
@@ -557,8 +552,7 @@ rollforward()
* everything continues as if nothing had happened.
*/
void
-startnewtape(top)
- int top;
+startnewtape(int top)
{
int parentpid;
int childpid;
@@ -695,8 +689,7 @@ restore_check_point:
}
void
-dumpabort(signo)
- int signo;
+dumpabort(int signo)
{
if (master != 0 && master != getpid())
@@ -713,8 +706,7 @@ dumpabort(signo)
}
__dead void
-Exit(status)
- int status;
+Exit(int status)
{
#ifdef TDEBUG
@@ -727,8 +719,7 @@ Exit(status)
* proceed - handler for SIGUSR2, used to synchronize IO between the slaves.
*/
void
-proceed(signo)
- int signo;
+proceed(int signo)
{
if (ready)
@@ -737,7 +728,7 @@ proceed(signo)
}
void
-enslave()
+enslave(void)
{
int cmd[2];
int i, j;
@@ -774,15 +765,15 @@ enslave()
}
for (i = 0; i < SLAVES; i++)
- (void) atomic(write, slaves[i].fd,
- (char *) &slaves[(i + 1) % SLAVES].pid,
- sizeof(slaves[0].pid));
+ (void) atomic((ssize_t (*)(int, void *, size_t))write,
+ slaves[i].fd, (char *) &slaves[(i + 1) % SLAVES].pid,
+ sizeof(slaves[0].pid));
master = 0;
}
void
-killall()
+killall(void)
{
int i;
@@ -801,9 +792,7 @@ killall()
* get the lock back for the next cycle by swapping descriptors.
*/
static void
-doslave(cmd, slave_number)
- int cmd;
- int slave_number;
+doslave(int cmd, int slave_number)
{
int nread;
int nextslave, size, eot_count;
@@ -901,7 +890,8 @@ doslave(cmd, slave_number)
* pass size of write back to master
* (for EOT handling)
*/
- (void) atomic(write, cmd, (char *)&size, sizeof(size));
+ (void) atomic((ssize_t (*)(int, void *, size_t))write,
+ cmd, (char *)&size, sizeof(size));
}
/*
@@ -920,11 +910,7 @@ doslave(cmd, slave_number)
* loop until the count is satisfied (or error).
*/
static ssize_t
-atomic(func, fd, buf, count)
- ssize_t (*func)();
- int fd;
- char *buf;
- int count;
+atomic(ssize_t (*func)(int, void *, size_t), int fd, char *buf, int count)
{
ssize_t got, need = count;
diff --git a/sbin/dump/traverse.c b/sbin/dump/traverse.c
index 00bb3b067a2..a32bf9dcb29 100644
--- a/sbin/dump/traverse.c
+++ b/sbin/dump/traverse.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: traverse.c,v 1.12 2003/06/02 20:06:14 millert Exp $ */
+/* $OpenBSD: traverse.c,v 1.13 2003/06/26 16:35:21 deraadt Exp $ */
/* $NetBSD: traverse.c,v 1.17 1997/06/05 11:13:27 lukem Exp $ */
/*-
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)traverse.c 8.2 (Berkeley) 9/23/93";
#else
-static char rcsid[] = "$OpenBSD: traverse.c,v 1.12 2003/06/02 20:06:14 millert Exp $";
+static char rcsid[] = "$OpenBSD: traverse.c,v 1.13 2003/06/26 16:35:21 deraadt Exp $";
#endif
#endif /* not lint */
@@ -79,8 +79,7 @@ static int searchdir(ino_t ino, daddr_t blkno, long size, off_t filesize);
* hence the estimate may be high.
*/
off_t
-blockest(dp)
- struct dinode *dp;
+blockest(struct dinode *dp)
{
off_t blkest, sizeest;
@@ -128,10 +127,7 @@ blockest(dp)
* Determine if given inode should be dumped
*/
void
-mapfileino(ino, tapesize, dirskipped)
- ino_t ino;
- off_t *tapesize;
- int *dirskipped;
+mapfileino(ino_t ino, off_t *tapesize, int *dirskipped)
{
int mode;
struct dinode *dp;
@@ -162,11 +158,7 @@ mapfileino(ino, tapesize, dirskipped)
* the directories in the filesystem.
*/
int
-mapfiles(maxino, tapesize, disk, dirv)
- ino_t maxino;
- off_t *tapesize;
- char *disk;
- char * const *dirv;
+mapfiles(ino_t maxino, off_t *tapesize, char *disk, char * const *dirv)
{
int anydirskipped = 0;
@@ -181,7 +173,7 @@ mapfiles(maxino, tapesize, disk, dirv)
dumpabort(0);
}
if ((dirh = fts_open(dirv, FTS_PHYSICAL|FTS_SEEDOT|FTS_XDEV,
- (int (*)())NULL)) == NULL) {
+ NULL)) == NULL) {
msg("fts_open failed: %s\n", strerror(errno));
dumpabort(0);
}
@@ -265,9 +257,7 @@ mapfiles(maxino, tapesize, disk, dirv)
* pass using this algorithm.
*/
int
-mapdirs(maxino, tapesize)
- ino_t maxino;
- off_t *tapesize;
+mapdirs(ino_t maxino, off_t *tapesize)
{
struct dinode *dp;
int i, isdir;
@@ -322,11 +312,7 @@ mapdirs(maxino, tapesize)
* require the directory to be dumped.
*/
static int
-dirindir(ino, blkno, ind_level, filesize)
- ino_t ino;
- daddr_t blkno;
- int ind_level;
- off_t *filesize;
+dirindir(ino_t ino, daddr_t blkno, int ind_level, off_t *filesize)
{
int ret = 0;
int i;
@@ -361,11 +347,7 @@ dirindir(ino, blkno, ind_level, filesize)
* contains any subdirectories.
*/
static int
-searchdir(ino, blkno, size, filesize)
- ino_t ino;
- daddr_t blkno;
- long size;
- off_t filesize;
+searchdir(ino_t ino, daddr_t blkno, long size, off_t filesize)
{
struct direct *dp;
long loc;
@@ -410,9 +392,7 @@ searchdir(ino, blkno, size, filesize)
* Dump the contents of an inode to tape.
*/
void
-dumpino(dp, ino)
- struct dinode *dp;
- ino_t ino;
+dumpino(struct dinode *dp, ino_t ino)
{
int ind_level, cnt;
off_t size;
@@ -490,11 +470,7 @@ dumpino(dp, ino)
* Read indirect blocks, and pass the data blocks to be dumped.
*/
static void
-dmpindir(ino, blk, ind_level, size)
- ino_t ino;
- daddr_t blk;
- int ind_level;
- off_t *size;
+dmpindir(ino_t ino, daddr_t blk, int ind_level, off_t *size)
{
int i, cnt;
daddr_t idblk[MAXNINDIR];
@@ -524,10 +500,7 @@ dmpindir(ino, blk, ind_level, size)
* Collect up the data into tape record sized buffers and output them.
*/
void
-blksout(blkp, frags, ino)
- daddr_t *blkp;
- int frags;
- ino_t ino;
+blksout(daddr_t *blkp, int frags, ino_t ino)
{
daddr_t *bp;
int i, j, count, blks, tbperdb;
@@ -603,8 +576,7 @@ writeheader(ino)
}
struct dinode *
-getino(inum)
- ino_t inum;
+getino(ino_t inum)
{
static daddr_t minino, maxino;
static struct dinode inoblock[MAXINOPB];
@@ -629,10 +601,7 @@ int breaderrors = 0;
#define BREADEMAX 32
void
-bread(blkno, buf, size)
- daddr_t blkno;
- char *buf;
- int size;
+bread(daddr_t blkno, char *buf, int size)
{
int cnt, i;
diff --git a/sbin/route/ccitt_addr.c b/sbin/route/ccitt_addr.c
index f1eabb8bc75..bdf8ad6201a 100644
--- a/sbin/route/ccitt_addr.c
+++ b/sbin/route/ccitt_addr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ccitt_addr.c,v 1.7 2003/06/02 20:06:16 millert Exp $ */
+/* $OpenBSD: ccitt_addr.c,v 1.8 2003/06/26 16:35:21 deraadt Exp $ */
/* $NetBSD: ccitt_addr.c,v 1.8 1995/04/23 10:33:41 cgd Exp $ */
/*
@@ -57,8 +57,10 @@
static char *copychar(char *, char *);
+int ccitt_addr(char *addr, struct sockaddr_x25 *xp);
+
int
-ccitt_addr (addr, xp)
+ccitt_addr(addr, xp)
char *addr;
struct sockaddr_x25 *xp;
{
diff --git a/sbin/route/route.c b/sbin/route/route.c
index 940edab037c..aa5d3af82bf 100644
--- a/sbin/route/route.c
+++ b/sbin/route/route.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: route.c,v 1.57 2003/06/02 20:06:16 millert Exp $ */
+/* $OpenBSD: route.c,v 1.58 2003/06/26 16:35:21 deraadt Exp $ */
/* $NetBSD: route.c,v 1.16 1996/04/15 18:27:05 cgd Exp $ */
/*
@@ -40,7 +40,7 @@ static const char copyright[] =
#if 0
static const char sccsid[] = "@(#)route.c 8.3 (Berkeley) 3/19/94";
#else
-static const char rcsid[] = "$OpenBSD: route.c,v 1.57 2003/06/02 20:06:16 millert Exp $";
+static const char rcsid[] = "$OpenBSD: route.c,v 1.58 2003/06/26 16:35:21 deraadt Exp $";
#endif
#endif /* not lint */
@@ -88,7 +88,7 @@ union sockunion {
typedef union sockunion *sup;
pid_t pid;
int rtm_addrs, s;
-int forcehost, forcenet, doflush, nflag, af, qflag, tflag, keyword();
+int forcehost, forcenet, doflush, nflag, af, qflag, tflag, keyword(char *);
int iflag, verbose, aflen = sizeof (struct sockaddr_in);
int locking, lockrest, debugonly;
struct rt_metrics rt_metrics;
@@ -361,8 +361,8 @@ routename(struct sockaddr *sa)
struct hostent *hp;
static char domain[MAXHOSTNAMELEN];
static int first = 1;
- char *ns_print();
- char *ipx_print();
+ char *ns_print(struct sockaddr_ns *);
+ char *ipx_print(struct sockaddr_ipx *);
if (first) {
first = 0;
@@ -465,8 +465,8 @@ netname(struct sockaddr *sa)
static char line[MAXHOSTNAMELEN];
struct netent *np = 0;
in_addr_t net, mask, subnetshift;
- char *ns_print();
- char *ipx_print();
+ char *ns_print(struct sockaddr_ns *);
+ char *ipx_print(struct sockaddr_ipx *);
switch (sa->sa_family) {
@@ -905,10 +905,7 @@ int
getaddr(int which, char *s, struct hostent **hpp)
{
sup su = NULL;
- struct ns_addr ns_addr();
- struct ipx_addr ipx_addr();
- struct iso_addr *iso_addr();
- struct ccitt_addr *ccitt_addr();
+ struct ccitt_addr *ccitt_addr(char *, struct sockaddr_x25 *);
struct hostent *hp;
struct netent *np;
u_long val;
diff --git a/sbin/route/show.c b/sbin/route/show.c
index 2b196f7315a..f04673fdef8 100644
--- a/sbin/route/show.c
+++ b/sbin/route/show.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: show.c,v 1.23 2003/06/02 20:06:16 millert Exp $ */
+/* $OpenBSD: show.c,v 1.24 2003/06/26 16:35:21 deraadt Exp $ */
/* $NetBSD: show.c,v 1.1 1996/11/15 18:01:41 gwr Exp $ */
/*
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "from: @(#)route.c 8.3 (Berkeley) 3/9/94";
#else
-static char *rcsid = "$OpenBSD: show.c,v 1.23 2003/06/02 20:06:16 millert Exp $";
+static char *rcsid = "$OpenBSD: show.c,v 1.24 2003/06/26 16:35:21 deraadt Exp $";
#endif
#endif /* not lint */
@@ -111,9 +111,7 @@ void usage(char *);
* Print routing tables.
*/
void
-show(argc, argv)
- int argc;
- char **argv;
+show(int argc, char *argv[])
{
struct rt_msghdr *rtm;
char *buf = NULL, *next, *lim = NULL;