summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/cat/cat.c20
-rw-r--r--bin/chio/chio.c72
-rw-r--r--bin/chmod/chmod.c19
-rw-r--r--bin/cp/cp.c20
-rw-r--r--bin/cp/utils.c29
-rw-r--r--bin/date/date.c15
-rw-r--r--bin/date/netdate.c7
-rw-r--r--bin/df/df.c57
-rw-r--r--bin/df/ext2fs_df.c7
-rw-r--r--bin/df/ffs_df.c7
-rw-r--r--bin/df/lfs_df.c7
-rw-r--r--bin/domainname/domainname.c10
-rw-r--r--bin/echo/echo.c8
-rw-r--r--bin/expr/expr.c46
-rw-r--r--bin/hostname/hostname.c10
-rw-r--r--bin/kill/kill.c19
-rw-r--r--bin/ln/ln.c14
-rw-r--r--bin/mkdir/mkdir.c15
-rw-r--r--bin/mt/mt.c18
-rw-r--r--bin/mv/mv.c20
-rw-r--r--bin/pwd/pwd.c10
-rw-r--r--bin/rcp/rcp.c33
-rw-r--r--bin/rcp/util.c24
-rw-r--r--bin/rm/rm.c27
-rw-r--r--bin/rmail/rmail.c10
-rw-r--r--bin/rmdir/rmdir.c13
-rw-r--r--bin/sleep/sleep.c13
-rw-r--r--bin/sync/sync.c8
-rw-r--r--bin/test/test.c93
29 files changed, 221 insertions, 430 deletions
diff --git a/bin/cat/cat.c b/bin/cat/cat.c
index 44e33756b1d..3f38cc2b5d0 100644
--- a/bin/cat/cat.c
+++ b/bin/cat/cat.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cat.c,v 1.13 2002/03/14 21:17:50 millert Exp $ */
+/* $OpenBSD: cat.c,v 1.14 2002/07/04 04:26:39 deraadt Exp $ */
/* $NetBSD: cat.c,v 1.11 1995/09/07 06:12:54 jtc Exp $ */
/*
@@ -47,7 +47,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)cat.c 8.2 (Berkeley) 4/27/95";
#else
-static char rcsid[] = "$OpenBSD: cat.c,v 1.13 2002/03/14 21:17:50 millert Exp $";
+static char rcsid[] = "$OpenBSD: cat.c,v 1.14 2002/07/04 04:26:39 deraadt Exp $";
#endif
#endif /* not lint */
@@ -76,9 +76,7 @@ void raw_args(char *argv[]);
void raw_cat(int);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ch;
@@ -125,8 +123,7 @@ main(argc, argv)
}
void
-cook_args(argv)
- char **argv;
+cook_args(char **argv)
{
FILE *fp;
@@ -151,8 +148,7 @@ cook_args(argv)
}
void
-cook_buf(fp)
- FILE *fp;
+cook_buf(FILE *fp)
{
int ch, gobble, line, prev;
@@ -209,8 +205,7 @@ cook_buf(fp)
}
void
-raw_args(argv)
- char **argv;
+raw_args(char **argv)
{
int fd;
@@ -235,8 +230,7 @@ raw_args(argv)
}
void
-raw_cat(rfd)
- int rfd;
+raw_cat(int rfd)
{
int nr, nw, off, wfd;
static int bsize;
diff --git a/bin/chio/chio.c b/bin/chio/chio.c
index deee9b68a79..25fd2aefc32 100644
--- a/bin/chio/chio.c
+++ b/bin/chio/chio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: chio.c,v 1.10 2002/02/16 21:27:06 millert Exp $ */
+/* $OpenBSD: chio.c,v 1.11 2002/07/04 04:26:39 deraadt Exp $ */
/* $NetBSD: chio.c,v 1.1.1.1 1996/04/03 00:34:38 thorpej Exp $ */
/*
@@ -51,7 +51,6 @@
extern char *__progname; /* from crt0.o */
static void usage(void);
-static void cleanup(void);
static int parse_element_type(char *);
static int parse_element_unit(char *);
static int parse_special(char *);
@@ -99,9 +98,7 @@ static int changer_fd;
static char *changer_name;
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
int ch, i;
@@ -130,10 +127,6 @@ main(argc, argv)
if ((changer_fd = open(changer_name, O_RDWR, 0600)) == -1)
err(1, "%s: open", changer_name);
- /* Register cleanup function. */
- if (atexit(cleanup))
- err(1, "can't register cleanup function");
-
/* Find the specified command. */
for (i = 0; commands[i].cc_name != NULL; ++i)
if (strcmp(*argv, commands[i].cc_name) == 0)
@@ -154,10 +147,7 @@ main(argc, argv)
}
static int
-do_move(cname, argc, argv)
- char *cname;
- int argc;
- char **argv;
+do_move(char *cname, int argc, char *argv[])
{
struct changer_move cmd;
int val;
@@ -222,10 +212,7 @@ do_move(cname, argc, argv)
}
static int
-do_exchange(cname, argc, argv)
- char *cname;
- int argc;
- char **argv;
+do_exchange(char *cname, int argc, char *argv[])
{
struct changer_exchange cmd;
int val;
@@ -316,10 +303,7 @@ do_exchange(cname, argc, argv)
}
static int
-do_position(cname, argc, argv)
- char *cname;
- int argc;
- char **argv;
+do_position(char *cname, int argc, char *argv[])
{
struct changer_position cmd;
int val;
@@ -376,10 +360,7 @@ do_position(cname, argc, argv)
}
static int
-do_params(cname, argc, argv)
- char *cname;
- int argc;
- char **argv;
+do_params(char *cname, int argc, char *argv[])
{
struct changer_params data;
@@ -412,10 +393,7 @@ do_params(cname, argc, argv)
}
static int
-do_getpicker(cname, argc, argv)
- char *cname;
- int argc;
- char **argv;
+do_getpicker(char *cname, int argc, char *argv[])
{
int picker;
@@ -439,10 +417,7 @@ do_getpicker(cname, argc, argv)
}
static int
-do_setpicker(cname, argc, argv)
- char *cname;
- int argc;
- char **argv;
+do_setpicker(char *cname, int argc, char *argv[])
{
int picker;
@@ -468,10 +443,7 @@ do_setpicker(cname, argc, argv)
}
static int
-do_status(cname, argc, argv)
- char *cname;
- int argc;
- char **argv;
+do_status(char *cname, int argc, char *argv[])
{
struct changer_element_status cmd;
struct changer_params data;
@@ -580,8 +552,7 @@ do_status(cname, argc, argv)
}
static int
-parse_element_type(cp)
- char *cp;
+parse_element_type(char *cp)
{
int i;
@@ -593,8 +564,7 @@ parse_element_type(cp)
}
static int
-parse_element_unit(cp)
- char *cp;
+parse_element_unit(char *cp)
{
int i;
char *p;
@@ -607,8 +577,7 @@ parse_element_unit(cp)
}
static int
-parse_special(cp)
- char *cp;
+parse_special(char *cp)
{
int val;
@@ -620,8 +589,7 @@ parse_special(cp)
}
static int
-is_special(cp)
- char *cp;
+is_special(char *cp)
{
int i;
@@ -633,9 +601,7 @@ is_special(cp)
}
static char *
-bits_to_string(v, cp)
- int v;
- const char *cp;
+bits_to_string(int v, const char *cp)
{
const char *np;
char f, sep, *bp;
@@ -661,15 +627,7 @@ bits_to_string(v, cp)
}
static void
-cleanup()
-{
-
- /* Simple enough... */
- (void)close(changer_fd);
-}
-
-static void
-usage()
+usage(void)
{
int i;
diff --git a/bin/chmod/chmod.c b/bin/chmod/chmod.c
index b449a0d803c..6c86ad73904 100644
--- a/bin/chmod/chmod.c
+++ b/bin/chmod/chmod.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: chmod.c,v 1.13 2002/02/16 21:27:06 millert Exp $ */
+/* $OpenBSD: chmod.c,v 1.14 2002/07/04 04:26:39 deraadt Exp $ */
/* $NetBSD: chmod.c,v 1.12 1995/03/21 09:02:09 cgd Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)chmod.c 8.8 (Berkeley) 4/1/94";
#else
-static char rcsid[] = "$OpenBSD: chmod.c,v 1.13 2002/02/16 21:27:06 millert Exp $";
+static char rcsid[] = "$OpenBSD: chmod.c,v 1.14 2002/07/04 04:26:39 deraadt Exp $";
#endif
#endif /* not lint */
@@ -71,9 +71,7 @@ uid_t a_uid(const char *);
void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
FTS *ftsp;
FTSENT *p;
@@ -285,8 +283,7 @@ done: argv += optind;
}
uid_t
-a_uid(s)
- const char *s;
+a_uid(const char *s)
{
struct passwd *pw;
char *ep;
@@ -302,13 +299,13 @@ a_uid(s)
err(1, "%s", s);
if (*ep != '\0')
errx(1, "%s: invalid user name", s);
+ /* XXX long -> int */
return (uid_t)ul;
}
}
gid_t
-a_gid(s)
- const char *s;
+a_gid(const char *s)
{
struct group *gr;
char *ep;
@@ -324,12 +321,13 @@ a_gid(s)
err(1, "%s", s);
if (*ep != '\0')
errx(1, "%s: invalid group name", s);
+ /* XXX long -> int */
return (gid_t)ul;
}
}
void
-usage()
+usage(void)
{
if (ischmod || ischflags)
fprintf(stderr,
@@ -339,6 +337,5 @@ usage()
fprintf(stderr,
"usage: %s [-R [-H | -L | -P]] [-f] [-h] %s file ...\n",
__progname, ischown ? "[owner][:group]" : "group");
-
exit(1);
}
diff --git a/bin/cp/cp.c b/bin/cp/cp.c
index cbe40e293a0..daafd581640 100644
--- a/bin/cp/cp.c
+++ b/bin/cp/cp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cp.c,v 1.19 2002/06/09 05:47:26 todd Exp $ */
+/* $OpenBSD: cp.c,v 1.20 2002/07/04 04:26:39 deraadt Exp $ */
/* $NetBSD: cp.c,v 1.14 1995/09/07 06:14:51 jtc Exp $ */
/*
@@ -47,7 +47,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)cp.c 8.5 (Berkeley) 4/29/95";
#else
-static char rcsid[] = "$OpenBSD: cp.c,v 1.19 2002/06/09 05:47:26 todd Exp $";
+static char rcsid[] = "$OpenBSD: cp.c,v 1.20 2002/07/04 04:26:39 deraadt Exp $";
#endif
#endif /* not lint */
@@ -102,9 +102,7 @@ int mastercmp(const FTSENT **, const FTSENT **);
char *find_last_component(char *);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct stat to_stat, tmp_stat;
enum op type;
@@ -251,9 +249,7 @@ main(argc, argv)
}
char *
-find_last_component(path)
- char *path;
-
+find_last_component(char *path)
{
char *p;
@@ -278,10 +274,7 @@ find_last_component(path)
}
int
-copy(argv, type, fts_options)
- char *argv[];
- enum op type;
- int fts_options;
+copy(char *argv[], enum op type, int fts_options)
{
struct stat to_stat;
FTS *ftsp;
@@ -482,8 +475,7 @@ copy(argv, type, fts_options)
* files first reduces seeking.
*/
int
-mastercmp(a, b)
- const FTSENT **a, **b;
+mastercmp(const FTSENT **a, const FTSENT **b)
{
int a_info, b_info;
diff --git a/bin/cp/utils.c b/bin/cp/utils.c
index 6b0c2736e51..e39286932b5 100644
--- a/bin/cp/utils.c
+++ b/bin/cp/utils.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: utils.c,v 1.19 2002/05/30 06:20:27 deraadt Exp $ */
+/* $OpenBSD: utils.c,v 1.20 2002/07/04 04:26:39 deraadt Exp $ */
/* $NetBSD: utils.c,v 1.6 1997/02/26 14:40:51 cgd Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)utils.c 8.3 (Berkeley) 4/1/94";
#else
-static char rcsid[] = "$OpenBSD: utils.c,v 1.19 2002/05/30 06:20:27 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: utils.c,v 1.20 2002/07/04 04:26:39 deraadt Exp $";
#endif
#endif /* not lint */
@@ -59,9 +59,7 @@ static char rcsid[] = "$OpenBSD: utils.c,v 1.19 2002/05/30 06:20:27 deraadt Exp
#include "extern.h"
int
-copy_file(entp, dne)
- FTSENT *entp;
- int dne;
+copy_file(FTSENT *entp, int dne)
{
static char buf[MAXBSIZE];
struct stat to_stat, *fs;
@@ -188,9 +186,7 @@ copy_file(entp, dne)
}
int
-copy_link(p, exists)
- FTSENT *p;
- int exists;
+copy_link(FTSENT *p, int exists)
{
int len;
char link[MAXPATHLEN];
@@ -212,9 +208,7 @@ copy_link(p, exists)
}
int
-copy_fifo(from_stat, exists)
- struct stat *from_stat;
- int exists;
+copy_fifo(struct stat *from_stat, int exists)
{
if (exists && unlink(to.p_path)) {
warn("unlink: %s", to.p_path);
@@ -228,9 +222,7 @@ copy_fifo(from_stat, exists)
}
int
-copy_special(from_stat, exists)
- struct stat *from_stat;
- int exists;
+copy_special(struct stat *from_stat, int exists)
{
if (exists && unlink(to.p_path)) {
warn("unlink: %s", to.p_path);
@@ -245,9 +237,7 @@ copy_special(from_stat, exists)
int
-setfile(fs, fd)
- struct stat *fs;
- int fd;
+setfile(struct stat *fs, int fd)
{
static struct timeval tv[2];
int rval;
@@ -298,8 +288,7 @@ setfile(fs, fd)
int
-setlink(fs)
- struct stat *fs;
+setlink(struct stat *fs)
{
if (lchown(to.p_path, fs->st_uid, fs->st_gid)) {
@@ -313,7 +302,7 @@ setlink(fs)
void
-usage()
+usage(void)
{
(void)fprintf(stderr,
"usage: %s [-R [-H | -L | -P]] [-fip] src target\n", __progname);
diff --git a/bin/date/date.c b/bin/date/date.c
index ec668c33bb5..7c4a5c5f331 100644
--- a/bin/date/date.c
+++ b/bin/date/date.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: date.c,v 1.22 2002/04/17 03:54:30 deraadt Exp $ */
+/* $OpenBSD: date.c,v 1.23 2002/07/04 04:26:39 deraadt Exp $ */
/* $NetBSD: date.c,v 1.11 1995/09/07 06:21:05 jtc Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)date.c 8.2 (Berkeley) 4/28/95";
#else
-static char rcsid[] = "$OpenBSD: date.c,v 1.22 2002/04/17 03:54:30 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: date.c,v 1.23 2002/07/04 04:26:39 deraadt Exp $";
#endif
#endif /* not lint */
@@ -77,9 +77,7 @@ static void badformat(void);
static void usage(void);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
struct timezone tz;
int ch, rflag;
@@ -155,8 +153,7 @@ main(argc, argv)
#define ATOI2(ar) ((ar)[0] - '0') * 10 + ((ar)[1] - '0'); (ar) += 2;
void
-setthetime(p)
- char *p;
+setthetime(char *p)
{
struct tm *lt;
struct timeval tv;
@@ -262,14 +259,14 @@ setthetime(p)
}
static void
-badformat()
+badformat(void)
{
warnx("illegal time format");
usage();
}
static void
-usage()
+usage(void)
{
(void)fprintf(stderr,
"usage: %s [-anu] [-d dst] [-r seconds] [-t west] [+format]\n",
diff --git a/bin/date/netdate.c b/bin/date/netdate.c
index 7107cb9bc53..3e242428312 100644
--- a/bin/date/netdate.c
+++ b/bin/date/netdate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: netdate.c,v 1.13 2001/07/05 22:32:35 espie Exp $ */
+/* $OpenBSD: netdate.c,v 1.14 2002/07/04 04:26:39 deraadt Exp $ */
/* $NetBSD: netdate.c,v 1.10 1995/09/07 06:21:06 jtc Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)netdate.c 8.2 (Berkeley) 4/28/95";
#else
-static char rcsid[] = "$OpenBSD: netdate.c,v 1.13 2001/07/05 22:32:35 espie Exp $";
+static char rcsid[] = "$OpenBSD: netdate.c,v 1.14 2002/07/04 04:26:39 deraadt Exp $";
#endif
#endif /* not lint */
@@ -74,8 +74,7 @@ extern int retval;
* Returns 0 on success. Returns > 0 on failure, setting retval to 2;
*/
int
-netsettime(tval)
- time_t tval;
+netsettime(time_t tval)
{
struct timeval tout;
struct servent *sp;
diff --git a/bin/df/df.c b/bin/df/df.c
index 2c0c1073fe9..5e086b8c499 100644
--- a/bin/df/df.c
+++ b/bin/df/df.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: df.c,v 1.31 2002/02/16 21:27:06 millert Exp $ */
+/* $OpenBSD: df.c,v 1.32 2002/07/04 04:26:39 deraadt Exp $ */
/* $NetBSD: df.c,v 1.21.2.1 1995/11/01 00:06:11 jtc Exp $ */
/*
@@ -49,7 +49,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)df.c 8.7 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: df.c,v 1.31 2002/02/16 21:27:06 millert Exp $";
+static char rcsid[] = "$OpenBSD: df.c,v 1.32 2002/07/04 04:26:39 deraadt Exp $";
#endif
#endif /* not lint */
@@ -86,9 +86,7 @@ int hflag, iflag, kflag, lflag, nflag, Pflag;
char **typelist = NULL;
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct stat stbuf;
struct statfs *mntbuf;
@@ -193,8 +191,7 @@ main(argc, argv)
}
char *
-getmntpt(name)
- char *name;
+getmntpt(char *name)
{
long mntsize, i;
struct statfs *mntbuf;
@@ -210,8 +207,7 @@ getmntpt(name)
static enum { IN_LIST, NOT_IN_LIST } which;
int
-selected(type)
- const char *type;
+selected(const char *type)
{
char **av;
@@ -225,8 +221,7 @@ selected(type)
}
void
-maketypelist(fslist)
- char *fslist;
+maketypelist(char *fslist)
{
int i;
char *nextcp, **av;
@@ -267,9 +262,7 @@ maketypelist(fslist)
* current (not cached) info. Returns the new count of valid statfs bufs.
*/
long
-regetmntinfo(mntbufp, mntsize)
- struct statfs **mntbufp;
- long mntsize;
+regetmntinfo(struct statfs **mntbufp, long mntsize)
{
int i, j;
struct statfs *mntbuf;
@@ -301,8 +294,7 @@ regetmntinfo(mntbufp, mntsize)
typedef enum { NONE = 0, KILO, MEGA, GIGA, TERA, PETA /* , EXA */ } unit_t;
unit_t
-unit_adjust(val)
- double *val;
+unit_adjust(double *val)
{
double abval;
unit_t unit;
@@ -330,8 +322,7 @@ unit_adjust(val)
}
void
-prthumanval(bytes)
- double bytes;
+prthumanval(double bytes)
{
unit_t unit;
@@ -346,9 +337,7 @@ prthumanval(bytes)
}
void
-prthuman(sfsp, used)
- struct statfs *sfsp;
- long used;
+prthuman(struct statfs *sfsp, long used)
{
prthumanval((double)(sfsp->f_blocks) * (double)(sfsp->f_bsize));
prthumanval((double)(used) * (double)(sfsp->f_bsize));
@@ -367,9 +356,7 @@ prthuman(sfsp, used)
* Print out status about a filesystem.
*/
void
-prtstat(sfsp, maxwidth, headerlen, blocksize)
- struct statfs *sfsp;
- int maxwidth, headerlen, blocksize;
+prtstat(struct statfs *sfsp, int maxwidth, int headerlen, int blocksize)
{
u_int32_t used, inodes;
int32_t availblks;
@@ -400,10 +387,7 @@ prtstat(sfsp, maxwidth, headerlen, blocksize)
* Print in traditional BSD format.
*/
void
-bsdprint(mntbuf, mntsize, maxwidth)
- struct statfs *mntbuf;
- long mntsize;
- int maxwidth;
+bsdprint(struct statfs *mntbuf, long mntsize, int maxwidth)
{
int i;
char *header;
@@ -440,10 +424,7 @@ bsdprint(mntbuf, mntsize, maxwidth)
* Print in format defined by POSIX 1002.2, invoke with -P option.
*/
void
-posixprint(mntbuf, mntsize, maxwidth)
- struct statfs *mntbuf;
- long mntsize;
- int maxwidth;
+posixprint(struct statfs *mntbuf, long mntsize, int maxwidth)
{
int i;
int blocklen;
@@ -486,9 +467,7 @@ posixprint(mntbuf, mntsize, maxwidth)
}
int
-raw_df(file, sfsp)
- char *file;
- struct statfs *sfsp;
+raw_df(char *file, struct statfs *sfsp)
{
int rfd;
@@ -512,11 +491,7 @@ raw_df(file, sfsp)
}
int
-bread(rfd, off, buf, cnt)
- int rfd;
- off_t off;
- void *buf;
- int cnt;
+bread(int rfd, off_t off, void *buf, int cnt)
{
int nr;
@@ -532,7 +507,7 @@ bread(rfd, off, buf, cnt)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr,
"usage: %s [-hiklnP] [-t type] [file | file_system ...]\n",
diff --git a/bin/df/ext2fs_df.c b/bin/df/ext2fs_df.c
index cde48ad1c1f..38423d2e818 100644
--- a/bin/df/ext2fs_df.c
+++ b/bin/df/ext2fs_df.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ext2fs_df.c,v 1.8 2002/02/16 21:27:06 millert Exp $ */
+/* $OpenBSD: ext2fs_df.c,v 1.9 2002/07/04 04:26:39 deraadt Exp $ */
/*
* This file is substantially derived from src/sys/ufs/ext2fs/ext2fs_vfsops.c:e2fs_statfs().
@@ -64,10 +64,7 @@ union {
#define sblock sb.ie_fs
int
-e2fs_df(rfd, file, sfsp)
- int rfd;
- char *file;
- struct statfs *sfsp;
+e2fs_df(int rfd, char *file, struct statfs *sfsp)
{
char *mntpt;
u_int32_t overhead, overhead_per_group;
diff --git a/bin/df/ffs_df.c b/bin/df/ffs_df.c
index b2e36afabc5..4fd3e26cb15 100644
--- a/bin/df/ffs_df.c
+++ b/bin/df/ffs_df.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ffs_df.c,v 1.7 2002/02/16 21:27:06 millert Exp $ */
+/* $OpenBSD: ffs_df.c,v 1.8 2002/07/04 04:26:39 deraadt Exp $ */
/*
* Copyright (c) 1980, 1990, 1993, 1994
@@ -66,10 +66,7 @@ union {
#define sblock sb.iu_fs
int
-ffs_df(rfd, file, sfsp)
- int rfd;
- char *file;
- struct statfs *sfsp;
+ffs_df(int rfd, char *file, struct statfs *sfsp)
{
char *mntpt;
diff --git a/bin/df/lfs_df.c b/bin/df/lfs_df.c
index eab3476719a..b57674acacf 100644
--- a/bin/df/lfs_df.c
+++ b/bin/df/lfs_df.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lfs_df.c,v 1.7 2002/02/16 21:27:06 millert Exp $ */
+/* $OpenBSD: lfs_df.c,v 1.8 2002/07/04 04:26:39 deraadt Exp $ */
/*
* This file is substantially duplicated from src/sys/ufs/lfs/lfs_vfsops.c:lfs_statfs().
@@ -64,10 +64,7 @@ union {
#define sblock sb.il_fs
int
-lfs_df(rfd, file, sfsp)
- int rfd;
- char *file;
- struct statfs *sfsp;
+lfs_df(int rfd, char *file, struct statfs *sfsp)
{
char *mntpt;
diff --git a/bin/domainname/domainname.c b/bin/domainname/domainname.c
index 01056e1d638..d6330d4de24 100644
--- a/bin/domainname/domainname.c
+++ b/bin/domainname/domainname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: domainname.c,v 1.5 2002/02/16 21:27:06 millert Exp $ */
+/* $OpenBSD: domainname.c,v 1.6 2002/07/04 04:26:39 deraadt Exp $ */
/* $NetBSD: domainname.c,v 1.7 1995/03/21 09:04:22 cgd Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)hostname.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: domainname.c,v 1.5 2002/02/16 21:27:06 millert Exp $";
+static char rcsid[] = "$OpenBSD: domainname.c,v 1.6 2002/07/04 04:26:39 deraadt Exp $";
#endif
#endif /* not lint */
@@ -61,9 +61,7 @@ extern char *__progname;
void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ch;
char domainname[MAXHOSTNAMELEN];
@@ -91,7 +89,7 @@ main(argc, argv)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: %s [name-of-domain]\n", __progname);
exit(1);
diff --git a/bin/echo/echo.c b/bin/echo/echo.c
index f13316ff55f..f86e0f41bfd 100644
--- a/bin/echo/echo.c
+++ b/bin/echo/echo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: echo.c,v 1.4 1997/09/01 18:29:26 deraadt Exp $ */
+/* $OpenBSD: echo.c,v 1.5 2002/07/04 04:26:39 deraadt Exp $ */
/* $NetBSD: echo.c,v 1.6 1995/03/21 09:04:27 cgd Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)echo.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: echo.c,v 1.4 1997/09/01 18:29:26 deraadt Exp $";
+static char rcsid[] = "$OpenBSD: echo.c,v 1.5 2002/07/04 04:26:39 deraadt Exp $";
#endif
#endif /* not lint */
@@ -54,9 +54,7 @@ static char rcsid[] = "$OpenBSD: echo.c,v 1.4 1997/09/01 18:29:26 deraadt Exp $"
/* ARGSUSED */
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int nflag;
diff --git a/bin/expr/expr.c b/bin/expr/expr.c
index 81391e3a458..c8119bcd708 100644
--- a/bin/expr/expr.c
+++ b/bin/expr/expr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: expr.c,v 1.11 2002/06/09 05:47:27 todd Exp $ */
+/* $OpenBSD: expr.c,v 1.12 2002/07/04 04:26:39 deraadt Exp $ */
/* $NetBSD: expr.c,v 1.3.6.1 1996/06/04 20:41:47 cgd Exp $ */
/*
@@ -36,10 +36,8 @@ enum token token;
struct val *tokval;
char **av;
-
struct val *
-make_int(i)
- int i;
+make_int(int i)
{
struct val *vp;
@@ -54,8 +52,7 @@ make_int(i)
struct val *
-make_str(s)
- char *s;
+make_str(char *s)
{
struct val *vp;
@@ -69,8 +66,7 @@ make_str(s)
void
-free_value(vp)
- struct val *vp;
+free_value(struct val *vp)
{
if (vp->type == string)
free(vp->u.s);
@@ -80,9 +76,7 @@ free_value(vp)
/* determine if vp is an integer; if so, return it's value in *r */
int
-is_integer(vp, r)
- struct val *vp;
- int *r;
+is_integer(struct val *vp, int *r)
{
char *s;
int neg;
@@ -124,8 +118,7 @@ is_integer(vp, r)
/* coerce to vp to an integer */
int
-to_integer(vp)
- struct val *vp;
+to_integer(struct val *vp)
{
int r;
@@ -145,8 +138,7 @@ to_integer(vp)
/* coerce to vp to an string */
void
-to_string(vp)
- struct val *vp;
+to_string(struct val *vp)
{
char *tmp;
@@ -163,8 +155,7 @@ to_string(vp)
}
int
-is_zero_or_null(vp)
- struct val *vp;
+is_zero_or_null(struct val *vp)
{
if (vp->type == integer) {
return (vp->u.i == 0);
@@ -175,8 +166,7 @@ is_zero_or_null(vp)
}
void
-nexttoken(pat)
- int pat;
+nexttoken(int pat)
{
char *p;
@@ -223,7 +213,7 @@ error()
}
struct val *
-eval6()
+eval6(void)
{
struct val *eval0(void);
struct val *v;
@@ -250,7 +240,7 @@ eval6()
/* Parse and evaluate match (regex) expressions */
struct val *
-eval5()
+eval5(void)
{
regex_t rp;
regmatch_t rm[2];
@@ -305,7 +295,7 @@ eval5()
/* Parse and evaluate multiplication and division expressions */
struct val *
-eval4()
+eval4(void)
{
struct val *l, *r;
enum token op;
@@ -340,7 +330,7 @@ eval4()
/* Parse and evaluate addition and subtraction expressions */
struct val *
-eval3()
+eval3(void)
{
struct val *l, *r;
enum token op;
@@ -368,7 +358,7 @@ eval3()
/* Parse and evaluate comparison expressions */
struct val *
-eval2()
+eval2(void)
{
struct val *l, *r;
enum token op;
@@ -441,7 +431,7 @@ eval2()
/* Parse and evaluate & expressions */
struct val *
-eval1()
+eval1(void)
{
struct val *l, *r;
@@ -464,7 +454,7 @@ eval1()
/* Parse and evaluate | expressions */
struct val *
-eval0()
+eval0(void)
{
struct val *l, *r;
@@ -486,9 +476,7 @@ eval0()
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
struct val *vp;
diff --git a/bin/hostname/hostname.c b/bin/hostname/hostname.c
index ca7775077cb..98dae83b58b 100644
--- a/bin/hostname/hostname.c
+++ b/bin/hostname/hostname.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hostname.c,v 1.5 2002/02/16 21:27:07 millert Exp $ */
+/* $OpenBSD: hostname.c,v 1.6 2002/07/04 04:26:40 deraadt Exp $ */
/* $NetBSD: hostname.c,v 1.10 1995/09/07 06:28:40 jtc Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)hostname.c 8.2 (Berkeley) 4/28/95";
#else
-static char rcsid[] = "$OpenBSD: hostname.c,v 1.5 2002/02/16 21:27:07 millert Exp $";
+static char rcsid[] = "$OpenBSD: hostname.c,v 1.6 2002/07/04 04:26:40 deraadt Exp $";
#endif
#endif /* not lint */
@@ -61,9 +61,7 @@ extern char *__progname;
void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ch, sflag;
char *p, hostname[MAXHOSTNAMELEN];
@@ -97,7 +95,7 @@ main(argc, argv)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: %s [-s] [name-of-host]\n", __progname);
exit(1);
diff --git a/bin/kill/kill.c b/bin/kill/kill.c
index 83256b3d8cb..f6f758d8609 100644
--- a/bin/kill/kill.c
+++ b/bin/kill/kill.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: kill.c,v 1.5 2002/02/16 21:27:07 millert Exp $ */
+/* $OpenBSD: kill.c,v 1.6 2002/07/04 04:26:40 deraadt Exp $ */
/* $NetBSD: kill.c,v 1.11 1995/09/07 06:30:27 jtc Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)kill.c 8.4 (Berkeley) 4/28/95";
#else
-static char rcsid[] = "$OpenBSD: kill.c,v 1.5 2002/02/16 21:27:07 millert Exp $";
+static char rcsid[] = "$OpenBSD: kill.c,v 1.6 2002/07/04 04:26:40 deraadt Exp $";
#endif
#endif /* not lint */
@@ -64,9 +64,7 @@ int signame_to_signum(char *);
void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int errors, numsig, pid;
char *ep;
@@ -144,8 +142,7 @@ main(argc, argv)
}
int
-signame_to_signum(sig)
- char *sig;
+signame_to_signum(char *sig)
{
int n;
@@ -159,8 +156,7 @@ signame_to_signum(sig)
}
void
-nosig(name)
- char *name;
+nosig(char *name)
{
warnx("unknown signal %s; valid signals:", name);
@@ -169,8 +165,7 @@ nosig(name)
}
void
-printsignals(fp)
- FILE *fp;
+printsignals(FILE *fp)
{
int n;
@@ -184,7 +179,7 @@ printsignals(fp)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: %s [-s signal_name] pid ...\n",
__progname);
diff --git a/bin/ln/ln.c b/bin/ln/ln.c
index 284d99257d7..f036a8ec218 100644
--- a/bin/ln/ln.c
+++ b/bin/ln/ln.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ln.c,v 1.7 2002/02/16 21:27:07 millert Exp $ */
+/* $OpenBSD: ln.c,v 1.8 2002/07/04 04:26:40 deraadt Exp $ */
/* $NetBSD: ln.c,v 1.10 1995/03/21 09:06:10 cgd Exp $ */
/*
@@ -44,7 +44,7 @@ static const char copyright[] =
#if 0
static const char sccsid[] = "@(#)ln.c 8.2 (Berkeley) 3/31/94";
#else
-static const char rcsid[] = "$OpenBSD: ln.c,v 1.7 2002/02/16 21:27:07 millert Exp $";
+static const char rcsid[] = "$OpenBSD: ln.c,v 1.8 2002/07/04 04:26:40 deraadt Exp $";
#endif
#endif /* not lint */
@@ -69,9 +69,7 @@ int linkit(char *, char *, int);
void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct stat sb;
int ch, exitval;
@@ -121,9 +119,7 @@ main(argc, argv)
}
int
-linkit(target, source, isdir)
- char *target, *source;
- int isdir;
+linkit(char *target, char *source, int isdir)
{
struct stat sb;
char *p, path[MAXPATHLEN];
@@ -168,7 +164,7 @@ linkit(target, source, isdir)
}
void
-usage()
+usage(void)
{
extern char *__progname;
diff --git a/bin/mkdir/mkdir.c b/bin/mkdir/mkdir.c
index 070eb0afe89..ec3106e206f 100644
--- a/bin/mkdir/mkdir.c
+++ b/bin/mkdir/mkdir.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mkdir.c,v 1.13 2002/06/09 05:34:26 todd Exp $ */
+/* $OpenBSD: mkdir.c,v 1.14 2002/07/04 04:26:40 deraadt Exp $ */
/* $NetBSD: mkdir.c,v 1.14 1995/06/25 21:59:21 mycroft Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)mkdir.c 8.2 (Berkeley) 1/25/94";
#else
-static char rcsid[] = "$OpenBSD: mkdir.c,v 1.13 2002/06/09 05:34:26 todd Exp $";
+static char rcsid[] = "$OpenBSD: mkdir.c,v 1.14 2002/07/04 04:26:40 deraadt Exp $";
#endif
#endif /* not lint */
@@ -65,9 +65,7 @@ int mkpath(char *, mode_t, mode_t);
void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ch, exitval, pflag;
mode_t *set;
@@ -145,10 +143,7 @@ main(argc, argv)
* dir_mode - file mode of intermediate directories
*/
int
-mkpath(path, mode, dir_mode)
- char *path;
- mode_t mode;
- mode_t dir_mode;
+mkpath(char *path, mode_t mode, mode_t dir_mode)
{
struct stat sb;
char *slash;
@@ -182,7 +177,7 @@ mkpath(path, mode, dir_mode)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: %s [-p] [-m mode] dirname ...\n", __progname);
exit(1);
diff --git a/bin/mt/mt.c b/bin/mt/mt.c
index cf713b172d8..ec6cf345a7c 100644
--- a/bin/mt/mt.c
+++ b/bin/mt/mt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mt.c,v 1.20 2002/02/16 21:27:07 millert Exp $ */
+/* $OpenBSD: mt.c,v 1.21 2002/07/04 04:26:40 deraadt Exp $ */
/* $NetBSD: mt.c,v 1.14.2.1 1996/05/27 15:12:11 mrg Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)mt.c 8.2 (Berkeley) 6/6/93";
#else
-static char rcsid[] = "$OpenBSD: mt.c,v 1.20 2002/02/16 21:27:07 millert Exp $";
+static char rcsid[] = "$OpenBSD: mt.c,v 1.21 2002/07/04 04:26:40 deraadt Exp $";
#endif
#endif /* not lint */
@@ -106,9 +106,7 @@ char *progname;
int eject = 0;
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
struct commands *comp;
struct mtget mt_status;
@@ -243,8 +241,7 @@ struct tape_desc {
* Interpret the status buffer returned
*/
void
-status(bp)
- struct mtget *bp;
+status(struct mtget *bp)
{
struct tape_desc *mt;
@@ -273,10 +270,7 @@ status(bp)
* Print a register a la the %b format of the kernel's printf.
*/
void
-printreg(s, v, bits)
- char *s;
- u_int v;
- char *bits;
+printreg(char *s, u_int v, char *bits)
{
int i, any = 0;
char c;
@@ -306,7 +300,7 @@ printreg(s, v, bits)
}
void
-usage()
+usage(void)
{
if (eject)
(void)fprintf(stderr, "usage: %s [-f] device\n", progname);
diff --git a/bin/mv/mv.c b/bin/mv/mv.c
index 5c4c678b225..43743409013 100644
--- a/bin/mv/mv.c
+++ b/bin/mv/mv.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mv.c,v 1.23 2002/02/16 21:27:07 millert Exp $ */
+/* $OpenBSD: mv.c,v 1.24 2002/07/04 04:26:40 deraadt Exp $ */
/* $NetBSD: mv.c,v 1.9 1995/03/21 09:06:52 cgd Exp $ */
/*
@@ -47,7 +47,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)mv.c 8.2 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: mv.c,v 1.23 2002/02/16 21:27:07 millert Exp $";
+static char rcsid[] = "$OpenBSD: mv.c,v 1.24 2002/07/04 04:26:40 deraadt Exp $";
#endif
#endif /* not lint */
@@ -80,9 +80,7 @@ int fastcopy(char *, char *, struct stat *);
void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int baselen, len, rval;
char *p, *endp;
@@ -168,8 +166,7 @@ main(argc, argv)
}
int
-do_move(from, to)
- char *from, *to;
+do_move(char *from, char *to)
{
struct stat sb, fsb;
char modep[15];
@@ -274,9 +271,7 @@ do_move(from, to)
}
int
-fastcopy(from, to, sbp)
- char *from, *to;
- struct stat *sbp;
+fastcopy(char *from, char *to, struct stat *sbp)
{
struct timeval tval[2];
static u_int blen;
@@ -362,8 +357,7 @@ err: if (unlink(to))
}
int
-copy(from, to)
- char *from, *to;
+copy(char *from, char *to)
{
int status;
pid_t pid;
@@ -408,7 +402,7 @@ copy(from, to)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: %s [-fi] source target\n", __progname);
(void)fprintf(stderr, " %s [-fi] source ... directory\n",
diff --git a/bin/pwd/pwd.c b/bin/pwd/pwd.c
index 46b2bb9da11..1c90f46ad74 100644
--- a/bin/pwd/pwd.c
+++ b/bin/pwd/pwd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pwd.c,v 1.7 2002/02/16 21:27:07 millert Exp $ */
+/* $OpenBSD: pwd.c,v 1.8 2002/07/04 04:26:40 deraadt Exp $ */
/* $NetBSD: pwd.c,v 1.7 1995/03/21 09:08:18 cgd Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)pwd.c 8.3 (Berkeley) 4/1/94";
#else
-static char rcsid[] = "$OpenBSD: pwd.c,v 1.7 2002/02/16 21:27:07 millert Exp $";
+static char rcsid[] = "$OpenBSD: pwd.c,v 1.8 2002/07/04 04:26:40 deraadt Exp $";
#endif
#endif /* not lint */
@@ -58,9 +58,7 @@ extern char *__progname;
void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ch;
char *p;
@@ -92,7 +90,7 @@ main(argc, argv)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: %s\n", __progname);
exit(1);
diff --git a/bin/rcp/rcp.c b/bin/rcp/rcp.c
index 87bfa63622c..b237e3311e5 100644
--- a/bin/rcp/rcp.c
+++ b/bin/rcp/rcp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rcp.c,v 1.30 2002/06/09 05:30:08 todd Exp $ */
+/* $OpenBSD: rcp.c,v 1.31 2002/07/04 04:26:40 deraadt Exp $ */
/* $NetBSD: rcp.c,v 1.9 1995/03/21 08:19:06 cgd Exp $ */
/*
@@ -115,9 +115,7 @@ 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, tflag;
@@ -235,9 +233,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, *user;
@@ -329,9 +325,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, *user;
@@ -396,9 +390,7 @@ tolocal(argc, argv)
}
void
-source(argc, argv)
- int argc;
- char *argv[];
+source(int argc, char *argv[])
{
struct stat stb;
static BUF buffer;
@@ -493,9 +485,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;
@@ -546,9 +536,7 @@ rsource(name, statp)
}
void
-sink(argc, argv)
- int argc;
- char *argv[];
+sink(int argc, char *argv[])
{
static BUF buffer;
struct stat stb;
@@ -786,8 +774,7 @@ screwup:
#ifdef KERBEROS
int
-kerberos(host, bp, locuser, user)
- char **host, *bp, *locuser, *user;
+kerberos(char **host, char *bp, char *locuser, char *user)
{
struct servent *sp;
@@ -825,7 +812,7 @@ again:
#endif /* KERBEROS */
int
-response()
+response(void)
{
char ch, *cp, resp, rbuf[BUFSIZ];
@@ -858,7 +845,7 @@ response()
}
void
-usage()
+usage(void)
{
#ifdef KERBEROS
(void)fprintf(stderr, "usage: %s [-Kpx] [-k realm] f1 f2\n",
diff --git a/bin/rcp/util.c b/bin/rcp/util.c
index 6613730d14c..2e007c30b18 100644
--- a/bin/rcp/util.c
+++ b/bin/rcp/util.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: util.c,v 1.10 2001/08/29 20:44:03 markus Exp $ */
+/* $OpenBSD: util.c,v 1.11 2002/07/04 04:26:40 deraadt Exp $ */
/* $NetBSD: util.c,v 1.2 1995/03/21 08:19:08 cgd Exp $ */
/*-
@@ -38,7 +38,7 @@
#if 0
static char sccsid[] = "@(#)util.c 8.2 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: util.c,v 1.10 2001/08/29 20:44:03 markus Exp $";
+static char rcsid[] = "$OpenBSD: util.c,v 1.11 2002/07/04 04:26:40 deraadt Exp $";
#endif
#endif /* not lint */
@@ -59,8 +59,7 @@ static char rcsid[] = "$OpenBSD: util.c,v 1.10 2001/08/29 20:44:03 markus Exp $"
#include "extern.h"
char *
-colon(cp)
- char *cp;
+colon(char *cp)
{
for (; *cp; ++cp) {
if (*cp == ':')
@@ -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;
@@ -137,9 +132,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;
@@ -169,8 +162,7 @@ allocbuf(bp, fd, blksize)
}
void
-lostconn(signo)
- int signo;
+lostconn(int signo)
{
extern char *__progname;
char buf[1024];
diff --git a/bin/rm/rm.c b/bin/rm/rm.c
index 587e0893a14..715d214fb64 100644
--- a/bin/rm/rm.c
+++ b/bin/rm/rm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rm.c,v 1.12 2002/02/16 21:27:07 millert Exp $ */
+/* $OpenBSD: rm.c,v 1.13 2002/07/04 04:26:40 deraadt Exp $ */
/* $NetBSD: rm.c,v 1.19 1995/09/07 06:48:50 jtc Exp $ */
/*-
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)rm.c 8.8 (Berkeley) 4/27/95";
#else
-static char rcsid[] = "$OpenBSD: rm.c,v 1.12 2002/02/16 21:27:07 millert Exp $";
+static char rcsid[] = "$OpenBSD: rm.c,v 1.13 2002/07/04 04:26:40 deraadt Exp $";
#endif
#endif /* not lint */
@@ -84,9 +84,7 @@ void usage(void);
* file removal.
*/
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ch, rflag;
@@ -140,8 +138,7 @@ main(argc, argv)
}
void
-rm_tree(argv)
- char **argv;
+rm_tree(char **argv)
{
FTS *fts;
FTSENT *p;
@@ -244,8 +241,7 @@ rm_tree(argv)
}
void
-rm_file(argv)
- char **argv;
+rm_file(char **argv)
{
struct stat sb;
int rval;
@@ -308,9 +304,7 @@ rm_file(argv)
* kernel support.
*/
void
-rm_overwrite(file, sbp)
- char *file;
- struct stat *sbp;
+rm_overwrite(char *file, struct stat *sbp)
{
struct stat sb;
struct statfs fsb;
@@ -362,9 +356,7 @@ err: eval = 1;
int
-check(path, name, sp)
- char *path, *name;
- struct stat *sp;
+check(char *path, char *name, struct stat *sp)
{
int ch, first;
char modep[15];
@@ -405,8 +397,7 @@ check(path, name, sp)
*/
#define ISDOT(a) ((a)[0] == '.' && (!(a)[1] || ((a)[1] == '.' && !(a)[2])))
void
-checkdot(argv)
- char **argv;
+checkdot(char **argv)
{
char *p, **save, **t;
int complained;
@@ -437,7 +428,7 @@ checkdot(argv)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: %s [-dfiPRrW] file ...\n", __progname);
exit(1);
diff --git a/bin/rmail/rmail.c b/bin/rmail/rmail.c
index e2da117a88e..6a19ca449aa 100644
--- a/bin/rmail/rmail.c
+++ b/bin/rmail/rmail.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rmail.c,v 1.12 2002/02/16 21:27:07 millert Exp $ */
+/* $OpenBSD: rmail.c,v 1.13 2002/07/04 04:26:40 deraadt Exp $ */
/* $NetBSD: rmail.c,v 1.8 1995/09/07 06:51:50 jtc Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)rmail.c 8.3 (Berkeley) 5/15/95";
#else
-static char rcsid[] = "$OpenBSD: rmail.c,v 1.12 2002/02/16 21:27:07 millert Exp $";
+static char rcsid[] = "$OpenBSD: rmail.c,v 1.13 2002/07/04 04:26:40 deraadt Exp $";
#endif
#endif /* not lint */
@@ -95,9 +95,7 @@ void usage(void);
#define TAYLOR_ENV /* use UU_MACHINE if present */
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
FILE *fp;
struct stat sb;
@@ -358,7 +356,7 @@ main(argc, argv)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: %s [-T] [-D domain] user ...\n",
__progname);
diff --git a/bin/rmdir/rmdir.c b/bin/rmdir/rmdir.c
index 2419d03789e..223e6ed919f 100644
--- a/bin/rmdir/rmdir.c
+++ b/bin/rmdir/rmdir.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rmdir.c,v 1.6 2002/02/16 21:27:07 millert Exp $ */
+/* $OpenBSD: rmdir.c,v 1.7 2002/07/04 04:26:40 deraadt Exp $ */
/* $NetBSD: rmdir.c,v 1.13 1995/03/21 09:08:31 cgd Exp $ */
/*-
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)rmdir.c 8.3 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: rmdir.c,v 1.6 2002/02/16 21:27:07 millert Exp $";
+static char rcsid[] = "$OpenBSD: rmdir.c,v 1.7 2002/07/04 04:26:40 deraadt Exp $";
#endif
#endif /* not lint */
@@ -62,9 +62,7 @@ int rm_path(char *);
void usage(void);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ch, errors;
int pflag;
@@ -106,8 +104,7 @@ main(argc, argv)
}
int
-rm_path(path)
- char *path;
+rm_path(char *path)
{
char *p;
@@ -127,7 +124,7 @@ rm_path(path)
}
void
-usage()
+usage(void)
{
fprintf(stderr, "usage: %s [-p] directory ...\n", __progname);
exit(1);
diff --git a/bin/sleep/sleep.c b/bin/sleep/sleep.c
index 1cc058f1cc6..069bcde170e 100644
--- a/bin/sleep/sleep.c
+++ b/bin/sleep/sleep.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sleep.c,v 1.13 2002/05/31 05:18:56 pjanzen Exp $ */
+/* $OpenBSD: sleep.c,v 1.14 2002/07/04 04:26:40 deraadt Exp $ */
/* $NetBSD: sleep.c,v 1.8 1995/03/21 09:11:11 cgd Exp $ */
/*
@@ -44,7 +44,7 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)sleep.c 8.3 (Berkeley) 4/2/94";
#else
-static char rcsid[] = "$OpenBSD: sleep.c,v 1.13 2002/05/31 05:18:56 pjanzen Exp $";
+static char rcsid[] = "$OpenBSD: sleep.c,v 1.14 2002/07/04 04:26:40 deraadt Exp $";
#endif
#endif /* not lint */
@@ -63,9 +63,7 @@ void usage(void);
void alarmh(int);
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
int ch;
time_t secs = 0, t;
@@ -127,7 +125,7 @@ main(argc, argv)
}
void
-usage()
+usage(void)
{
(void)fprintf(stderr, "usage: %s seconds\n", __progname);
exit(1);
@@ -138,8 +136,7 @@ usage()
* of SIGALRM.
*/
void
-alarmh(sigraised)
- int sigraised;
+alarmh(int sigraised)
{
/*
* exit() flushes stdio buffers, which is not legal in a signal
diff --git a/bin/sync/sync.c b/bin/sync/sync.c
index 4ab8249cf88..cdf02b2c492 100644
--- a/bin/sync/sync.c
+++ b/bin/sync/sync.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sync.c,v 1.3 2001/05/18 07:32:36 mickey Exp $ */
+/* $OpenBSD: sync.c,v 1.4 2002/07/04 04:26:40 deraadt Exp $ */
/* $NetBSD: sync.c,v 1.7 1995/03/21 09:11:37 cgd Exp $ */
/*
@@ -44,16 +44,14 @@ static char copyright[] =
#if 0
static char sccsid[] = "@(#)sync.c 8.1 (Berkeley) 5/31/93";
#else
-static char rcsid[] = "$OpenBSD: sync.c,v 1.3 2001/05/18 07:32:36 mickey Exp $";
+static char rcsid[] = "$OpenBSD: sync.c,v 1.4 2002/07/04 04:26:40 deraadt Exp $";
#endif
#endif /* not lint */
#include <unistd.h>
int
-main(argc, argv)
- int argc;
- char *argv[];
+main(int argc, char *argv[])
{
sync();
return(0);
diff --git a/bin/test/test.c b/bin/test/test.c
index d6fabb24615..a3c301e69b5 100644
--- a/bin/test/test.c
+++ b/bin/test/test.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: test.c,v 1.6 2001/11/05 07:39:16 mpech Exp $ */
+/* $OpenBSD: test.c,v 1.7 2002/07/04 04:26:40 deraadt Exp $ */
/* $NetBSD: test.c,v 1.15 1995/03/21 07:04:06 cgd Exp $ */
/*
@@ -12,7 +12,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: test.c,v 1.6 2001/11/05 07:39:16 mpech Exp $";
+static char rcsid[] = "$OpenBSD: test.c,v 1.7 2002/07/04 04:26:40 deraadt Exp $";
#endif
#include <sys/types.h>
@@ -143,22 +143,20 @@ char **t_wp;
struct t_op const *t_wp_op;
static enum token t_lex();
-static int oexpr();
-static int aexpr();
-static int nexpr();
-static int binop();
-static int primary();
-static int filstat();
-static int getn();
+static int oexpr(enum token n);
+static int aexpr(enum token n);
+static int nexpr(enum token n);
+static int binop(void);
+static int primary(enum token n);
+static int filstat(char *nm, enum token mode);
+static int getn(const char *s);
static int newerf();
static int olderf();
static int equalf();
-static void syntax();
+static void syntax(const char *op, char *msg);
int
-main(argc, argv)
- int argc;
- char **argv;
+main(int argc, char *argv[])
{
int res;
@@ -209,9 +207,7 @@ main(argc, argv)
}
static __dead void
-syntax(op, msg)
- char *op;
- char *msg;
+syntax(const char *op, char *msg)
{
if (op && *op)
errx(2, "%s: %s", op, msg);
@@ -220,8 +216,7 @@ syntax(op, msg)
}
static int
-oexpr(n)
- enum token n;
+oexpr(enum token n)
{
int res;
@@ -233,8 +228,7 @@ oexpr(n)
}
static int
-aexpr(n)
- enum token n;
+aexpr(enum token n)
{
int res;
@@ -246,8 +240,7 @@ aexpr(n)
}
static int
-nexpr(n)
- enum token n; /* token */
+nexpr(enum token n)
{
if (n == UNOT)
return !nexpr(t_lex(*++t_wp));
@@ -255,8 +248,7 @@ nexpr(n)
}
static int
-primary(n)
- enum token n;
+primary(enum token n)
{
int res;
@@ -292,7 +284,7 @@ primary(n)
}
static int
-binop()
+binop(void)
{
const char *opnd1, *opnd2;
struct t_op const *op;
@@ -326,19 +318,17 @@ binop()
case INTLT:
return getn(opnd1) < getn(opnd2);
case FILNT:
- return newerf (opnd1, opnd2);
+ return newerf(opnd1, opnd2);
case FILOT:
- return olderf (opnd1, opnd2);
+ return olderf(opnd1, opnd2);
case FILEQ:
- return equalf (opnd1, opnd2);
+ return equalf(opnd1, opnd2);
}
/* NOTREACHED */
}
static int
-filstat(nm, mode)
- char *nm;
- enum token mode;
+filstat(char *nm, enum token mode)
{
struct stat s;
int i;
@@ -418,8 +408,7 @@ filebit:
}
static enum token
-t_lex(s)
- char *s;
+t_lex(char *s)
{
struct t_op const *op = ops;
@@ -440,8 +429,7 @@ t_lex(s)
/* atoi with error detection */
static int
-getn(s)
- char *s;
+getn(const char *s)
{
char *p;
long r;
@@ -450,47 +438,44 @@ getn(s)
r = strtol(s, &p, 10);
if (errno != 0)
- errx(2, "%s: out of range", s);
+ errx(2, "%s: out of range", s);
while (isspace(*p))
- p++;
+ p++;
if (*p)
- errx(2, "%s: bad number", s);
+ errx(2, "%s: bad number", s);
return (int) r;
}
static int
-newerf (f1, f2)
-char *f1, *f2;
+newerf(char *f1, char *f2)
{
struct stat b1, b2;
- return (stat (f1, &b1) == 0 &&
- stat (f2, &b2) == 0 &&
- b1.st_mtime > b2.st_mtime);
+ return (stat(f1, &b1) == 0 &&
+ stat(f2, &b2) == 0 &&
+ b1.st_mtime > b2.st_mtime);
}
static int
-olderf (f1, f2)
-char *f1, *f2;
+olderf(char *f1, char *f2)
{
struct stat b1, b2;
- return (stat (f1, &b1) == 0 &&
- stat (f2, &b2) == 0 &&
- b1.st_mtime < b2.st_mtime);
+ return (stat(f1, &b1) == 0 &&
+ stat(f2, &b2) == 0 &&
+ b1.st_mtime < b2.st_mtime);
}
static int
-equalf (f1, f2)
-char *f1, *f2;
+equalf(char *f1, char *f2)
{
struct stat b1, b2;
- return (stat (f1, &b1) == 0 &&
- stat (f2, &b2) == 0 &&
- b1.st_dev == b2.st_dev &&
- b1.st_ino == b2.st_ino);
+ return (stat(f1, &b1) == 0 &&
+ stat(f2, &b2) == 0 &&
+ b1.st_dev == b2.st_dev &&
+ b1.st_ino == b2.st_ino);
}