diff options
author | charnier <charnier@FreeBSD.org> | 1997-11-24 07:27:06 +0000 |
---|---|---|
committer | charnier <charnier@FreeBSD.org> | 1997-11-24 07:27:06 +0000 |
commit | 2066ba97cf5c286395d1e3584cff4e8fdb31a545 (patch) | |
tree | 9977be3575366e0e8048c1a3c6b51ac9b87b8085 /libexec/lfs_cleanerd/misc.c | |
parent | e3613c1ac3a4b511341940c0bfc4df0ddbdc8582 (diff) | |
download | FreeBSD-src-2066ba97cf5c286395d1e3584cff4e8fdb31a545.zip FreeBSD-src-2066ba97cf5c286395d1e3584cff4e8fdb31a545.tar.gz |
Use err(3) instead of local redefinition. Add usage. -Wall cleaning.
Diffstat (limited to 'libexec/lfs_cleanerd/misc.c')
-rw-r--r-- | libexec/lfs_cleanerd/misc.c | 49 |
1 files changed, 10 insertions, 39 deletions
diff --git a/libexec/lfs_cleanerd/misc.c b/libexec/lfs_cleanerd/misc.c index ad6e11a..e0b7071 100644 --- a/libexec/lfs_cleanerd/misc.c +++ b/libexec/lfs_cleanerd/misc.c @@ -32,49 +32,20 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)misc.c 8.1 (Berkeley) 6/4/93"; +#endif +static const char rcsid[] = + "$Id$"; #endif /* not lint */ #include <sys/types.h> -#include <unistd.h> -#include <errno.h> -#include <stdlib.h> +#include <err.h> #include <stdio.h> +#include <stdlib.h> #include <string.h> - -extern char *special; - -#if __STDC__ -#include <stdarg.h> -#else -#include <varargs.h> -#endif - -void -#if __STDC__ -err(const int fatal, 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, "%s: ", special); - (void)vfprintf(stderr, fmt, ap); - va_end(ap); - if (errno) - (void)fprintf(stderr, " %s", strerror(errno)); - (void)fprintf(stderr, "\n"); - if (fatal) - exit(1); -} +#include <unistd.h> void get(fd, off, p, len) @@ -86,9 +57,9 @@ get(fd, off, p, len) int rbytes; if (lseek(fd, off, SEEK_SET) < 0) - err(1, "%s: %s", special, strerror(errno)); + err(1, NULL); if ((rbytes = read(fd, p, len)) < 0) - err(1, "%s: %s", special, strerror(errno)); + err(1, NULL); if (rbytes != len) - err(1, "%s: short read (%d, not %d)", special, rbytes, len); + errx(1, "short read (%d, not %d)", rbytes, len); } |