prettiness police
authorKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sat, 29 Apr 1995 01:17:10 +0000 (17:17 -0800)
committerKeith Bostic <bostic@ucbvax.Berkeley.EDU>
Sat, 29 Apr 1995 01:17:10 +0000 (17:17 -0800)
SCCS-vsn: sbin/dumpfs/dumpfs.c 8.3

usr/src/sbin/dumpfs/dumpfs.c

index 1e02458..84fbc47 100644 (file)
@@ -12,7 +12,7 @@ static char copyright[] =
 #endif /* not lint */
 
 #ifndef lint
 #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>
 #endif /* not lint */
 
 #include <sys/param.h>
@@ -21,13 +21,14 @@ static char sccsid[] = "@(#)dumpfs.c        8.2 (Berkeley) %G%";
 #include <ufs/ufs/dinode.h>
 #include <ufs/ffs/fs.h>
 
 #include <ufs/ufs/dinode.h>
 #include <ufs/ffs/fs.h>
 
-#include <unistd.h>
-#include <fcntl.h>
+#include <err.h>
 #include <errno.h>
 #include <errno.h>
+#include <fcntl.h>
 #include <fstab.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
 #include <fstab.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
+#include <unistd.h>
 
 union {
        struct fs fs;
 
 union {
        struct fs fs;
@@ -56,7 +57,7 @@ main(argc, argv)
        register struct fstab *fs;
        int ch, eval;
 
        register struct fstab *fs;
        int ch, eval;
 
-       while ((ch = getopt(argc, argv, "")) != EOF)
+       while ((ch = getopt(argc, argv, "")) != -1)
                switch(ch) {
                case '?':
                default:
                switch(ch) {
                case '?':
                default:
@@ -186,7 +187,7 @@ dumpfs(name)
 
 err:   if (fd != -1)
                (void)close(fd);
 
 err:   if (fd != -1)
                (void)close(fd);
-       (void)fprintf(stderr, "dumpfs: %s: %s\n", name, strerror(errno));
+       warn("%s", name);
        return (1);
 };
 
        return (1);
 };
 
@@ -203,7 +204,7 @@ dumpcg(name, fd, c)
            SEEK_SET)) == (off_t)-1)
                return (1);
        if (read(fd, &acg, afs.fs_bsize) != afs.fs_bsize) {
            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",
                return (1);
        }
        printf("magic\t%x\ttell\t%qx\ttime\t%s",