=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/calendar/calendar.c,v retrieving revision 1.17 retrieving revision 1.23 diff -u -r1.17 -r1.23 --- src/usr.bin/calendar/calendar.c 2002/02/16 21:27:44 1.17 +++ src/usr.bin/calendar/calendar.c 2004/12/10 15:31:01 1.23 @@ -1,4 +1,4 @@ -/* $OpenBSD: calendar.c,v 1.17 2002/02/16 21:27:44 millert Exp $ */ +/* $OpenBSD: calendar.c,v 1.23 2004/12/10 15:31:01 mickey Exp $ */ /* * Copyright (c) 1989, 1993, 1994 @@ -12,11 +12,7 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. - * 4. Neither the name of the University nor the names of its contributors + * 3. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * @@ -43,7 +39,7 @@ #if 0 static const char sccsid[] = "@(#)calendar.c 8.3 (Berkeley) 3/25/94"; #else -static char rcsid[] = "$OpenBSD: calendar.c,v 1.17 2002/02/16 21:27:44 millert Exp $"; +static const char rcsid[] = "$OpenBSD: calendar.c,v 1.23 2004/12/10 15:31:01 mickey Exp $"; #endif #endif /* not lint */ @@ -83,16 +79,14 @@ void childsig(int); int -main(argc, argv) - int argc; - char *argv[]; +main(int argc, char *argv[]) { int ch; char *caldir; (void)setlocale(LC_ALL, ""); - while ((ch = getopt(argc, argv, "-abf:t:A:B:")) != -1) + while ((ch = getopt(argc, argv, "abf:t:A:B:-")) != -1) switch (ch) { case '-': /* backward contemptible */ case 'a': @@ -190,8 +184,8 @@ (void)setlocale(LC_ALL, ""); if (setusercontext(NULL, pw, pw->pw_uid, LOGIN_SETALL ^ LOGIN_SETLOGIN)) - err(1, "unable to set user context (uid %d)", - (int)pw->pw_uid); + err(1, "unable to set user context (uid %u)", + pw->pw_uid); if (acstat) { if (chdir(pw->pw_dir) || stat(calendarFile, &sbuf) != 0 || @@ -233,11 +227,11 @@ * if there's only a zombie now. */ (void)kill(kid, SIGTERM); - warnx("uid %d did not finish in time", (int)pw->pw_uid); + warnx("uid %u did not finish in time", pw->pw_uid); } if (time(NULL) - t >= SECSPERDAY) - errx(2, "'calendar -a' took more than a day; stopped at uid %d", - (int)pw->pw_uid); + errx(2, "'calendar -a' took more than a day; stopped at uid %u", + pw->pw_uid); } for (;;) { deadkid = waitpid(-1, &kidstat, WNOHANG); @@ -260,17 +254,16 @@ void -usage() +usage(void) { (void)fprintf(stderr, - "usage: calendar [-a] [-A num] [-b] [-B num] [-t [[[cc]yy][mm]]dd] " - "[-f calendarfile]\n"); + "usage: calendar [-ab] [-A num] [-B num] [-f calendarfile] " + "[-t [[[cc]yy][mm]]dd]\n"); exit(1); } void -childsig(sig) - int sig; +childsig(int signo) { }