diff options
author | matteo <matteo@FreeBSD.org> | 2008-11-10 06:35:30 +0000 |
---|---|---|
committer | matteo <matteo@FreeBSD.org> | 2008-11-10 06:35:30 +0000 |
commit | 79b0ca8da7a3f9f7743f354dfd1368f99e5c49e8 (patch) | |
tree | 513f24faaa58e232d7ab9ee80f53dbfe034abe98 /usr.sbin/cron/crontab | |
parent | 34001f8d263157133991d55daa841af6e46068d2 (diff) | |
download | FreeBSD-src-79b0ca8da7a3f9f7743f354dfd1368f99e5c49e8.zip FreeBSD-src-79b0ca8da7a3f9f7743f354dfd1368f99e5c49e8.tar.gz |
Make usr.sbin/cron/crontab and usr.sbin/cron/lib WARNS=3 clean
Tested with: make universe
MFC after: 3 days
Diffstat (limited to 'usr.sbin/cron/crontab')
-rw-r--r-- | usr.sbin/cron/crontab/Makefile | 2 | ||||
-rw-r--r-- | usr.sbin/cron/crontab/crontab.c | 24 |
2 files changed, 12 insertions, 14 deletions
diff --git a/usr.sbin/cron/crontab/Makefile b/usr.sbin/cron/crontab/Makefile index 6b9486d..d136fb2 100644 --- a/usr.sbin/cron/crontab/Makefile +++ b/usr.sbin/cron/crontab/Makefile @@ -8,6 +8,8 @@ BINOWN= root BINMODE=4555 PRECIOUSPROG= +WARNS=3 + CFLAGS+= -I${.CURDIR}/../cron DPADD= ${LIBCRON} ${LIBMD} ${LIBUTIL} diff --git a/usr.sbin/cron/crontab/crontab.c b/usr.sbin/cron/crontab/crontab.c index dcb5e34..79d26e4 100644 --- a/usr.sbin/cron/crontab/crontab.c +++ b/usr.sbin/cron/crontab/crontab.c @@ -73,8 +73,7 @@ static int replace_cmd(void); static void -usage(msg) - char *msg; +usage(char *msg) { fprintf(stderr, "crontab: usage error: %s\n", msg); fprintf(stderr, "%s\n%s\n", @@ -85,9 +84,7 @@ usage(msg) int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int exitstatus; @@ -219,7 +216,7 @@ parse_args(argc, argv) err(ERROR_EXIT, "swapping uids"); if (!(NewCrontab = fopen(Filename, "r"))) err(ERROR_EXIT, "%s", Filename); - if (swap_uids() < OK) + if (swap_uids_back() < OK) err(ERROR_EXIT, "swapping uids back"); } } @@ -414,14 +411,14 @@ edit_cmd() { /* parent */ { - void (*f[4])(); - f[0] = signal(SIGHUP, SIG_IGN); - f[1] = signal(SIGINT, SIG_IGN); - f[2] = signal(SIGTERM, SIG_IGN); + void (*sig[3])(int signal); + sig[0] = signal(SIGHUP, SIG_IGN); + sig[1] = signal(SIGINT, SIG_IGN); + sig[2] = signal(SIGTERM, SIG_IGN); xpid = wait(&waiter); - signal(SIGHUP, f[0]); - signal(SIGINT, f[1]); - signal(SIGTERM, f[2]); + signal(SIGHUP, sig[0]); + signal(SIGINT, sig[1]); + signal(SIGTERM, sig[2]); } if (xpid != pid) { warnx("wrong PID (%d != %d) from \"%s\"", xpid, pid, editor); @@ -498,7 +495,6 @@ replace_cmd() { entry *e; time_t now = time(NULL); char **envp = env_init(); - void (*f[3])(); if (envp == NULL) { warnx("cannot allocate memory"); |