summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormatteo <matteo@FreeBSD.org>2008-11-10 06:35:30 +0000
committermatteo <matteo@FreeBSD.org>2008-11-10 06:35:30 +0000
commit79b0ca8da7a3f9f7743f354dfd1368f99e5c49e8 (patch)
tree513f24faaa58e232d7ab9ee80f53dbfe034abe98
parent34001f8d263157133991d55daa841af6e46068d2 (diff)
downloadFreeBSD-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
-rw-r--r--usr.sbin/cron/cron/cron.h3
-rw-r--r--usr.sbin/cron/crontab/Makefile2
-rw-r--r--usr.sbin/cron/crontab/crontab.c24
-rw-r--r--usr.sbin/cron/lib/Makefile2
-rw-r--r--usr.sbin/cron/lib/entry.c2
-rw-r--r--usr.sbin/cron/lib/misc.c10
6 files changed, 20 insertions, 23 deletions
diff --git a/usr.sbin/cron/cron/cron.h b/usr.sbin/cron/cron/cron.h
index e58cd85..38eb33b 100644
--- a/usr.sbin/cron/cron/cron.h
+++ b/usr.sbin/cron/cron/cron.h
@@ -221,6 +221,7 @@ int job_runqueue(void),
get_char(FILE *),
get_string(char *, int, FILE *, char *),
swap_uids(void),
+ swap_uids_back(void),
load_env(char *, FILE *),
cron_pclose(FILE *),
strcmp_until(char *, char *, int),
@@ -238,7 +239,7 @@ char *env_get(char *, char **),
user *load_user(int, struct passwd *, char *),
*find_user(cron_db *, char *);
-entry *load_entry(FILE *, void (*)(),
+entry *load_entry(FILE *, void (*)(char *),
struct passwd *, char **);
FILE *cron_popen(char *, char *, entry *);
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");
diff --git a/usr.sbin/cron/lib/Makefile b/usr.sbin/cron/lib/Makefile
index 296ebd0..5d8dcb8 100644
--- a/usr.sbin/cron/lib/Makefile
+++ b/usr.sbin/cron/lib/Makefile
@@ -4,6 +4,8 @@ LIB= cron
INTERNALLIB=
SRCS= entry.c env.c misc.c
+WARNS = 3
+
CFLAGS+= -I${.CURDIR}/../cron
CFLAGS+= -DLOGIN_CAP -DPAM
diff --git a/usr.sbin/cron/lib/entry.c b/usr.sbin/cron/lib/entry.c
index df88905..b6be69c 100644
--- a/usr.sbin/cron/lib/entry.c
+++ b/usr.sbin/cron/lib/entry.c
@@ -87,7 +87,7 @@ free_entry(e)
entry *
load_entry(file, error_func, pw, envp)
FILE *file;
- void (*error_func)();
+ void (*error_func)(char *);
struct passwd *pw;
char **envp;
{
diff --git a/usr.sbin/cron/lib/misc.c b/usr.sbin/cron/lib/misc.c
index e557afc..d56c03d 100644
--- a/usr.sbin/cron/lib/misc.c
+++ b/usr.sbin/cron/lib/misc.c
@@ -48,6 +48,7 @@ static const char rcsid[] =
static int LogFD = ERR;
+void mkprint(register char*, register unsigned char*, register int);
int
@@ -324,9 +325,7 @@ skip_comments(file)
* FALSE otherwise.
*/
static int
-in_file(string, file)
- char *string;
- FILE *file;
+in_file(char *string, FILE *file)
{
char line[MAX_TEMPSTR];
@@ -521,10 +520,7 @@ first_word(s, t)
* heavily ascii-dependent.
*/
void
-mkprint(dst, src, len)
- register char *dst;
- register unsigned char *src;
- register int len;
+mkprint(register char *dst, register unsigned char *src, register int len)
{
while (len-- > 0)
{
OpenPOWER on IntegriCloud