diff options
-rw-r--r-- | usr.sbin/accton/accton.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/usr.sbin/accton/accton.c b/usr.sbin/accton/accton.c index 0d1704b..af2fa89 100644 --- a/usr.sbin/accton/accton.c +++ b/usr.sbin/accton/accton.c @@ -32,23 +32,27 @@ */ #ifndef lint -static char copyright[] = +static const char copyright[] = "@(#) Copyright (c) 1988, 1993\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #ifndef lint +#if 0 static char sccsid[] = "@(#)accton.c 8.1 (Berkeley) 6/6/93"; +#endif +static const char rcsid[] = + "$Id$"; #endif /* not lint */ #include <sys/types.h> -#include <errno.h> -#include <unistd.h> -#include <stdlib.h> +#include <err.h> #include <stdio.h> +#include <stdlib.h> #include <string.h> +#include <unistd.h> -void usage __P((void)); +static void usage __P((void)); int main(argc, argv) @@ -68,18 +72,12 @@ main(argc, argv) switch(argc) { case 0: - if (acct(NULL)) { - (void)fprintf(stderr, - "accton: %s\n", strerror(errno)); - exit(1); - } + if (acct(NULL)) + err(1, NULL); break; case 1: - if (acct(*argv)) { - (void)fprintf(stderr, - "accton: %s: %s\n", *argv, strerror(errno)); - exit(1); - } + if (acct(*argv)) + err(1, "%s", *argv); break; default: usage(); @@ -87,7 +85,7 @@ main(argc, argv) exit(0); } -void +static void usage() { (void)fprintf(stderr, "usage: accton [file]\n"); |