Correct typo in comment.

Use errx instead of printf/exit.
Sort headers alphabetically.
This commit is contained in:
mjl 2000-10-04 19:14:53 +00:00
parent 7627a9213f
commit 277079480a
3 changed files with 15 additions and 20 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: at.c,v 1.15 2000/06/25 13:35:48 simonb Exp $ */
/* $NetBSD: at.c,v 1.16 2000/10/04 19:14:53 mjl Exp $ */
/*
* at.c : Put file into atrun queue
@ -35,6 +35,7 @@
#include <sys/wait.h>
#include <ctype.h>
#include <dirent.h>
#include <err.h>
#include <errno.h>
#include <fcntl.h>
#include <pwd.h>
@ -69,7 +70,7 @@ enum { ATQ, ATRM, AT, BATCH, CAT }; /* what program we want to run */
#if 0
static char rcsid[] = "$OpenBSD: at.c,v 1.15 1998/06/03 16:20:26 deraadt Exp $";
#else
__RCSID("$NetBSD: at.c,v 1.15 2000/06/25 13:35:48 simonb Exp $");
__RCSID("$NetBSD: at.c,v 1.16 2000/10/04 19:14:53 mjl Exp $");
#endif
#endif
@ -521,9 +522,7 @@ process_jobs(argc, argv, what)
for (i = optind; i < argc; i++) {
if (atoi(argv[i]) == jobno) {
if ((buf.st_uid != real_uid) && !(real_uid == 0)) {
(void)fprintf(stderr,
"%s: Not owner\n", argv[i]);
exit(EXIT_FAILURE);
errx(EXIT_FAILURE, "%s: Not owner", argv[i]);
}
switch (what) {
case ATRM:
@ -556,10 +555,8 @@ process_jobs(argc, argv, what)
break;
default:
(void)fprintf(stderr,
"Internal error, process_jobs = %d\n",
what);
exit(EXIT_FAILURE);
errx(EXIT_FAILURE, "Internal error, process_jobs = %d",
what);
break;
}
}
@ -677,9 +674,7 @@ main(argc, argv)
(void)fprintf(stderr, "%s version %.1f\n", namep, AT_VERSION);
if (!check_permission()) {
(void)fprintf(stderr, "You do not have permission to use %s.\n",
namep);
exit(EXIT_FAILURE);
errx(EXIT_FAILURE, "You do not have permission to use %s.", namep);
}
/* select our program */

View File

@ -1,4 +1,4 @@
/* $NetBSD: panic.c,v 1.6 1999/01/31 09:30:31 mrg Exp $ */
/* $NetBSD: panic.c,v 1.7 2000/10/04 19:14:53 mjl Exp $ */
/*
* panic.c - terminate fast in case of error
@ -27,6 +27,7 @@
/* System Headers */
#include <err.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@ -44,7 +45,7 @@
#if 0
static char rcsid[] = "$OpenBSD: panic.c,v 1.4 1997/03/01 23:40:09 millert Exp $";
#else
__RCSID("$NetBSD: panic.c,v 1.6 1999/01/31 09:30:31 mrg Exp $");
__RCSID("$NetBSD: panic.c,v 1.7 2000/10/04 19:14:53 mjl Exp $");
#endif
#endif
@ -60,14 +61,13 @@ panic(a)
/*
* Something fatal has happened, print error message and exit.
*/
(void)fprintf(stderr, "%s: %s\n", namep, a);
if (fcreated) {
PRIV_START
(void)unlink(atfile);
PRIV_END
}
exit(EXIT_FAILURE);
errx(EXIT_FAILURE, "%s: %s", namep, a);
}
void

View File

@ -1,4 +1,4 @@
/* $NetBSD: parsetime.c,v 1.9 2000/01/06 00:44:09 tron Exp $ */
/* $NetBSD: parsetime.c,v 1.10 2000/10/04 19:14:53 mjl Exp $ */
/*
* parsetime.c - parse time for at(1)
@ -38,6 +38,7 @@
/* System Headers */
#include <sys/types.h>
#include <ctype.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@ -45,7 +46,6 @@
#include <time.h>
#include <tzfile.h>
#include <unistd.h>
#include <ctype.h>
/* Local headers */
@ -133,7 +133,7 @@ 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 */
static size_t sc_len; /* scanner - lenght of token buffer */
static size_t sc_len; /* scanner - length of token buffer */
static int sc_tokid; /* scanner - token id */
static int sc_tokplur; /* scanner - is token plural? */
@ -141,7 +141,7 @@ static int sc_tokplur; /* scanner - is token plural? */
#if 0
static char rcsid[] = "$OpenBSD: parsetime.c,v 1.4 1997/03/01 23:40:10 millert Exp $";
#else
__RCSID("$NetBSD: parsetime.c,v 1.9 2000/01/06 00:44:09 tron Exp $");
__RCSID("$NetBSD: parsetime.c,v 1.10 2000/10/04 19:14:53 mjl Exp $");
#endif
#endif