#endif /* not lint */
#ifndef lint
-static char sccsid[] = "@(#)dumpfs.c 8.2 (Berkeley) %G%";
+static char sccsid[] = "@(#)dumpfs.c 8.3 (Berkeley) %G%";
#endif /* not lint */
#include <sys/param.h>
#include <ufs/ufs/dinode.h>
#include <ufs/ffs/fs.h>
-#include <unistd.h>
-#include <fcntl.h>
+#include <err.h>
#include <errno.h>
+#include <fcntl.h>
#include <fstab.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <unistd.h>
union {
struct fs fs;
register struct fstab *fs;
int ch, eval;
- while ((ch = getopt(argc, argv, "")) != EOF)
+ while ((ch = getopt(argc, argv, "")) != -1)
switch(ch) {
case '?':
default:
err: if (fd != -1)
(void)close(fd);
- (void)fprintf(stderr, "dumpfs: %s: %s\n", name, strerror(errno));
+ warn("%s", name);
return (1);
};
SEEK_SET)) == (off_t)-1)
return (1);
if (read(fd, &acg, afs.fs_bsize) != afs.fs_bsize) {
- (void)fprintf(stderr, "dumpfs: %s: error reading cg\n", name);
+ warnx("%s: error reading cg", name);
return (1);
}
printf("magic\t%x\ttell\t%qx\ttime\t%s",