diff options
author | charnier <charnier@FreeBSD.org> | 1997-10-01 06:30:02 +0000 |
---|---|---|
committer | charnier <charnier@FreeBSD.org> | 1997-10-01 06:30:02 +0000 |
commit | c8ef4a7a48d8f5d12953d95267505428c7f529f0 (patch) | |
tree | 652d4b08e3d4b8184e9130c4f56d427b5c60029c /usr.sbin/mtree/verify.c | |
parent | 9e9c06cc6a32be0e300ed8612438b503e0b8998e (diff) | |
download | FreeBSD-src-c8ef4a7a48d8f5d12953d95267505428c7f529f0.zip FreeBSD-src-c8ef4a7a48d8f5d12953d95267505428c7f529f0.tar.gz |
Use err(3) instead of local redefinition.
Diffstat (limited to 'usr.sbin/mtree/verify.c')
-rw-r--r-- | usr.sbin/mtree/verify.c | 18 |
1 files changed, 11 insertions, 7 deletions
diff --git a/usr.sbin/mtree/verify.c b/usr.sbin/mtree/verify.c index e435eb0..6610d3a 100644 --- a/usr.sbin/mtree/verify.c +++ b/usr.sbin/mtree/verify.c @@ -32,17 +32,22 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)verify.c 8.1 (Berkeley) 6/6/93"; +#endif +static const char rcsid[] = + "$Id$"; #endif /* not lint */ #include <sys/param.h> #include <sys/stat.h> #include <dirent.h> +#include <err.h> +#include <errno.h> #include <fts.h> #include <fnmatch.h> -#include <unistd.h> -#include <errno.h> #include <stdio.h> +#include <unistd.h> #include "mtree.h" #include "extern.h" @@ -50,6 +55,7 @@ extern long int crc_total; extern int ftsoptions; extern int dflag, eflag, rflag, sflag, uflag; extern char fullpath[MAXPATHLEN]; +extern int lineno; static NODE *root; static char path[MAXPATHLEN]; @@ -80,7 +86,7 @@ vwalk() argv[0] = "."; argv[1] = NULL; if ((t = fts_open(argv, ftsoptions, NULL)) == NULL) - err("fts_open: %s", strerror(errno)); + err(1, "line %d: fts_open", lineno); level = root; specdepth = rval = 0; while ((p = fts_read(t))) { @@ -97,8 +103,7 @@ vwalk() case FTS_DNR: case FTS_ERR: case FTS_NS: - (void)fprintf(stderr, "mtree: %s: %s\n", - RP(p), strerror(p->fts_errno)); + warnx("%s: %s", RP(p), strerror(p->fts_errno)); continue; default: if (dflag) @@ -143,8 +148,7 @@ extra: } (void)fts_close(t); if (sflag) - (void)fprintf(stderr, - "mtree: %s checksum: %lu\n", fullpath, crc_total); + warnx("%s checksum: %lu", fullpath, crc_total); return (rval); } |