use readlabelfs() if possible
authorderaadt <deraadt@openbsd.org>
Wed, 4 Dec 1996 01:31:10 +0000 (01:31 +0000)
committerderaadt <deraadt@openbsd.org>
Wed, 4 Dec 1996 01:31:10 +0000 (01:31 +0000)
sbin/fsck/Makefile
sbin/fsck/fsck.c

index 6615631..53fa7da 100644 (file)
@@ -1,8 +1,10 @@
-#      $OpenBSD: Makefile,v 1.3 1996/10/20 08:36:22 tholo Exp $
+#      $OpenBSD: Makefile,v 1.4 1996/12/04 01:31:10 deraadt Exp $
 #      $NetBSD: Makefile,v 1.14 1996/09/27 22:38:37 christos Exp $
 
 PROG=  fsck
 SRCS=  fsck.c fsutil.c preen.c
 MAN=   fsck.8
+DPADD= ${LIBUTIL}
+LDADD= -lutil
 
 .include <bsd.prog.mk>
index 5d1a150..d105bdf 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: fsck.c,v 1.1 1996/10/20 08:36:24 tholo Exp $  */
+/*     $OpenBSD: fsck.c,v 1.2 1996/12/04 01:31:11 deraadt Exp $        */
 /*     $NetBSD: fsck.c,v 1.7 1996/10/03 20:06:30 christos Exp $        */
 
 /*
@@ -54,6 +54,7 @@ static char rcsid[] = "$NetBSD: fsck.c,v 1.7 1996/10/03 20:06:30 christos Exp $"
 #include <stdlib.h>
 #include <string.h>
 #include <unistd.h>
+#include <util.h>
 
 #include "pathnames.h"
 #include "fsutil.h"
@@ -160,7 +161,10 @@ main(argc, argv)
        for (; argc--; argv++) {
                char *spec, *type;
 
-               if ((fs = getfsfile(*argv)) == NULL &&
+               if (strncmp(*argv, "/dev/", 5) == 0 &&
+                   (type = readlabelfs(*argv))) {
+                       spec = *argv;
+               } else if ((fs = getfsfile(*argv)) == NULL &&
                    (fs = getfsspec(*argv)) == NULL) {
                        if (vfstype == NULL)
                                errx(1,
@@ -168,8 +172,7 @@ main(argc, argv)
                                    *argv);
                        spec = *argv;
                        type = vfstype;
-               }
-               else {
+               } else {
                        spec = fs->fs_spec;
                        type = fs->fs_vfstype;
                        if (BADTYPE(fs->fs_type))