diff options
author | Chad Loder <cloder@cvs.openbsd.org> | 2006-04-26 03:01:49 +0000 |
---|---|---|
committer | Chad Loder <cloder@cvs.openbsd.org> | 2006-04-26 03:01:49 +0000 |
commit | c90049364f0f861016467caa9950ee1708fd451b (patch) | |
tree | 10a9471fa3e7fb034fce61a9ac0db95fe30c3075 /usr.bin | |
parent | 15c13b572670c55e3ea23fb4ace79f00b3655a60 (diff) |
Cleanup, remove an unused var, use an int to store argc instead of a char,
makes lint a bit happier. OK deraadt
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/at/at.c | 15 | ||||
-rw-r--r-- | usr.bin/at/parsetime.c | 12 |
2 files changed, 17 insertions, 10 deletions
diff --git a/usr.bin/at/at.c b/usr.bin/at/at.c index f6616d4cdc6..a7c4bfef13f 100644 --- a/usr.bin/at/at.c +++ b/usr.bin/at/at.c @@ -1,4 +1,4 @@ -/* $OpenBSD: at.c,v 1.45 2006/03/22 21:51:39 robert Exp $ */ +/* $OpenBSD: at.c,v 1.46 2006/04/26 03:01:48 cloder Exp $ */ /* * at.c : Put file into atrun queue @@ -42,7 +42,7 @@ #define TIMESIZE 50 /* Size of buffer passed to strftime() */ #ifndef lint -static const char rcsid[] = "$OpenBSD: at.c,v 1.45 2006/03/22 21:51:39 robert Exp $"; +static const char rcsid[] = "$OpenBSD: at.c,v 1.46 2006/04/26 03:01:48 cloder Exp $"; #endif /* Variables to remove from the job's environment. */ @@ -68,7 +68,7 @@ static void writefile(const char *, time_t, char); static void list_jobs(int, char **, int, int); static time_t ttime(const char *); static int check_permission(void); -static void panic(const char *); +static __dead void panic(const char *); static void perr(const char *); static void perr2(const char *, const char *); static __dead void usage(void); @@ -134,6 +134,7 @@ perr2(const char *a, const char *b) perr(b); } +/* ARGSUSED */ static void sigc(int signo) { @@ -147,6 +148,7 @@ sigc(int signo) _exit(ERROR_EXIT); } +/* ARGSUSED */ static void alarmc(int signo) { @@ -417,8 +419,8 @@ writefile(const char *cwd, time_t runtimer, char queue) static int byctime(const void *v1, const void *v2) { - const struct atjob *j1 = *(struct atjob **)v1; - const struct atjob *j2 = *(struct atjob **)v2; + const struct atjob *j1 = *(const struct atjob **)v1; + const struct atjob *j2 = *(const struct atjob **)v2; return (j1->ctime - j2->ctime); } @@ -639,7 +641,7 @@ process_jobs(int argc, char **argv, int what) struct passwd *pw; time_t runtimer; uid_t *uids; - char **jobs, *ep, queue; + char **jobs, *ep; long l; FILE *fp; DIR *spool; @@ -701,7 +703,6 @@ process_jobs(int argc, char **argv, int what) l < 0 || l >= INT_MAX) continue; runtimer = (time_t)l; - queue = *(ep + 1); /* Check runtimer against argv; argc==0 means do all. */ job_matches = (argc == 0) ? 1 : 0; diff --git a/usr.bin/at/parsetime.c b/usr.bin/at/parsetime.c index c3d8e36b8b3..eccdc4457e1 100644 --- a/usr.bin/at/parsetime.c +++ b/usr.bin/at/parsetime.c @@ -1,4 +1,4 @@ -/* $OpenBSD: parsetime.c,v 1.14 2004/06/17 22:09:11 millert Exp $ */ +/* $OpenBSD: parsetime.c,v 1.15 2006/04/26 03:01:48 cloder Exp $ */ /* * parsetime.c - parse time for at(1) @@ -132,7 +132,7 @@ struct { }; static char **scp; /* scanner - pointer at arglist */ -static char scc; /* scanner - count of remaining arguments */ +static int scc; /* scanner - count of remaining arguments */ static char *sct; /* scanner - next char pointer in current argument */ static int need; /* scanner - need to advance to next argument */ static char *sc_token; /* scanner - token buffer */ @@ -141,7 +141,7 @@ static int sc_tokid; /* scanner - token id */ static int sc_tokplur; /* scanner - is token plural? */ #ifndef lint -static const char rcsid[] = "$OpenBSD: parsetime.c,v 1.14 2004/06/17 22:09:11 millert Exp $"; +static const char rcsid[] = "$OpenBSD: parsetime.c,v 1.15 2006/04/26 03:01:48 cloder Exp $"; #endif /* @@ -341,10 +341,13 @@ plus(struct tm *tm) switch (token()) { case WEEKS: delay *= 7; + /* FALLTHROUGH */ case DAYS: delay *= 24; + /* FALLTHROUGH */ case HOURS: delay *= 60; + /* FALLTHROUGH */ case MINUTES: if (expectplur != sc_tokplur) fprintf(stderr, "%s: pluralization is wrong\n", @@ -644,8 +647,10 @@ parsetime(int argc, char **argv) */ case TEATIME: hr += 4; + /* FALLTHROUGH */ case NOON: hr += 12; + /* FALLTHROUGH */ case MIDNIGHT: if (runtime.tm_hour >= hr) { runtime.tm_mday++; @@ -655,6 +660,7 @@ parsetime(int argc, char **argv) runtime.tm_min = 0; token(); /* fall through to month setting */ + /* FALLTHROUGH */ default: if (month(&runtime) != 0) return (-1); |