diff options
author | charnier <charnier@FreeBSD.org> | 1997-08-11 07:28:19 +0000 |
---|---|---|
committer | charnier <charnier@FreeBSD.org> | 1997-08-11 07:28:19 +0000 |
commit | 12409694bd9cd25a5d6e5f676f6794ebcb19dc6e (patch) | |
tree | 330fbe281289b51fc96fb5e39ef47f24a2735180 /usr.bin/size | |
parent | 44c0b1badf6259bd10fd1dacdd631005e46766fc (diff) | |
download | FreeBSD-src-12409694bd9cd25a5d6e5f676f6794ebcb19dc6e.zip FreeBSD-src-12409694bd9cd25a5d6e5f676f6794ebcb19dc6e.tar.gz |
Use err(3) instead of local redefinition.
Diffstat (limited to 'usr.bin/size')
-rw-r--r-- | usr.bin/size/size.1 | 2 | ||||
-rw-r--r-- | usr.bin/size/size.1aout | 2 | ||||
-rw-r--r-- | usr.bin/size/size.c | 44 |
3 files changed, 12 insertions, 36 deletions
diff --git a/usr.bin/size/size.1 b/usr.bin/size/size.1 index ee46bb2..e99b9d1 100644 --- a/usr.bin/size/size.1 +++ b/usr.bin/size/size.1 @@ -56,6 +56,6 @@ attempts to report on the file .Xr a.out 5 .Sh HISTORY A -.Nm size +.Nm command appeared in .At v6 . diff --git a/usr.bin/size/size.1aout b/usr.bin/size/size.1aout index ee46bb2..e99b9d1 100644 --- a/usr.bin/size/size.1aout +++ b/usr.bin/size/size.1aout @@ -56,6 +56,6 @@ attempts to report on the file .Xr a.out 5 .Sh HISTORY A -.Nm size +.Nm command appeared in .At v6 . diff --git a/usr.bin/size/size.c b/usr.bin/size/size.c index b34e24c..50fc314 100644 --- a/usr.bin/size/size.c +++ b/usr.bin/size/size.c @@ -32,27 +32,30 @@ */ #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[] = "@(#)size.c 8.2 (Berkeley) 12/9/93"; +#endif +static const char rcsid[] = + "$Id$"; #endif /* not lint */ #include <sys/param.h> #include <sys/file.h> -#include <errno.h> +#include <err.h> #include <a.out.h> #include <unistd.h> #include <stdlib.h> #include <stdio.h> #include <string.h> -void err __P((const char *, ...)); int show __P((int, char *)); -void usage __P((void)); +static void usage __P((void)); int main(argc, argv) @@ -91,12 +94,12 @@ show(count, name) int fd; if ((fd = open(name, O_RDONLY, 0)) < 0) { - err("%s: %s", name, strerror(errno)); + warn("%s", name); return (1); } if (read(fd, &head, sizeof(head)) != sizeof(head) || N_BADMAG(head)) { (void)close(fd); - err("%s: not in a.out format", name); + warnx("%s: not in a.out format", name); return (1); } (void)close(fd); @@ -114,36 +117,9 @@ show(count, name) return (0); } -void +static void usage() { (void)fprintf(stderr, "usage: size [file ...]\n"); exit(1); } - -#if __STDC__ -#include <stdarg.h> -#else -#include <varargs.h> -#endif - -void -#if __STDC__ -err(const char *fmt, ...) -#else -err(fmt, va_alist) - char *fmt; - va_dcl -#endif -{ - va_list ap; -#if __STDC__ - va_start(ap, fmt); -#else - va_start(ap); -#endif - (void)fprintf(stderr, "size: "); - (void)vfprintf(stderr, fmt, ap); - va_end(ap); - (void)fprintf(stderr, "\n"); -} |