diff options
author | charnier <charnier@FreeBSD.org> | 1997-08-25 06:49:45 +0000 |
---|---|---|
committer | charnier <charnier@FreeBSD.org> | 1997-08-25 06:49:45 +0000 |
commit | e779aaeea32924e0708694dde350540711b5f05e (patch) | |
tree | cba09d36b8e7952b1bee71444c7862446e877d59 /usr.bin | |
parent | 628c52489fce4e129d14d36d586358f84e0e1ec1 (diff) | |
download | FreeBSD-src-e779aaeea32924e0708694dde350540711b5f05e.zip FreeBSD-src-e779aaeea32924e0708694dde350540711b5f05e.tar.gz |
Use err(3).
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/what/what.1 | 6 | ||||
-rw-r--r-- | usr.bin/what/what.c | 17 |
2 files changed, 15 insertions, 8 deletions
diff --git a/usr.bin/what/what.1 b/usr.bin/what/what.1 index e8bb617..c1a74c3 100644 --- a/usr.bin/what/what.1 +++ b/usr.bin/what/what.1 @@ -31,14 +31,14 @@ .\" .\" @(#)what.1 8.1 (Berkeley) 6/6/93 .\" -.\" $Id: what.1,v 1.4 1997/02/22 19:57:46 peter Exp $ +.\" $Id: what.1,v 1.5 1997/05/25 18:47:33 max Exp $ .\" .Dd June 6, 1993 .Dt WHAT 1 .Os BSD 4 .Sh NAME .Nm what -.Nd "show what versions of object modules were used to construct a file" +.Nd show what versions of object modules were used to construct a file .Sh SYNOPSIS .Nm what .Ar name Ar ... @@ -59,7 +59,7 @@ As is not licensed to distribute .Tn SCCS this is a rewrite of the -.Nm what +.Nm command which is part of .Tn SCCS , and may not behave exactly the same as that diff --git a/usr.bin/what/what.c b/usr.bin/what/what.c index ee90cee..91f114d 100644 --- a/usr.bin/what/what.c +++ b/usr.bin/what/what.c @@ -32,21 +32,29 @@ */ #ifndef lint -static char copyright[] = +static const char copyright[] = "@(#) Copyright (c) 1980, 1988, 1993\n\ The Regents of the University of California. All rights reserved.\n"; #endif /* not lint */ #ifndef lint +#if 0 static char sccsid[] = "@(#)what.c 8.1 (Berkeley) 6/6/93"; +#endif +static const char rcsid[] = + "$Id$"; #endif /* not lint */ +#include <err.h> #include <stdio.h> +void search __P((void)); + /* * what */ /* ARGSUSED */ +int main(argc, argv) int argc; char **argv; @@ -54,16 +62,15 @@ main(argc, argv) if (!*++argv) search(); else do { - if (!freopen(*argv, "r", stdin)) { - perror(*argv); - exit(1); - } + if (!freopen(*argv, "r", stdin)) + err(1, "%s", *argv); printf("%s\n", *argv); search(); } while(*++argv); exit(0); } +void search() { register int c; |