diff options
author | charnier <charnier@FreeBSD.org> | 1997-09-01 06:12:37 +0000 |
---|---|---|
committer | charnier <charnier@FreeBSD.org> | 1997-09-01 06:12:37 +0000 |
commit | 2f436049b377ab5b90a30ae9fa000b7be70b4d28 (patch) | |
tree | 56a67ac9f1ce37f3cfa588d891ff7f64dbde8991 | |
parent | 347508a51948d7f5efa1126217499e64e463d1e1 (diff) | |
download | FreeBSD-src-2f436049b377ab5b90a30ae9fa000b7be70b4d28.zip FreeBSD-src-2f436049b377ab5b90a30ae9fa000b7be70b4d28.tar.gz |
Use err(3).
-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"); |