]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fsck: don't try to call fsck for undefined fs type
authorKarel Zak <kzak@redhat.com>
Mon, 20 Feb 2012 21:22:58 +0000 (22:22 +0100)
committerKarel Zak <kzak@redhat.com>
Tue, 20 Mar 2012 10:22:09 +0000 (11:22 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
fsck/fsck.c

index ceaa5a62c1ed8f1b512b247f7fd0a8f72848db93..0945c58201209662f5ca2a56acf3a8e4d4bb0f5b 100644 (file)
@@ -465,7 +465,8 @@ static char *find_fsck(const char *type)
 
        for(s = strtok(p, ":"); s; s = strtok(NULL, ":")) {
                sprintf(prog, tpl, s, type);
-               if (stat(prog, &st) == 0) break;
+               if (stat(prog, &st) == 0)
+                       break;
        }
        free(p);
 
@@ -1003,8 +1004,12 @@ static int ignore(struct libmnt_fs *fs)
                return 1;
 
        type = mnt_fs_get_fstype(fs);
-       if (!type)
-               return 0;               /* should not happen */
+       if (!type) {
+               if (verbose)
+                       printf(_("%s: skipping unknown filesystem type\n"),
+                               fs_get_device(fs));
+               return 1;
+       }
 
        /* Are we ignoring this type? */
        if (fs_ignored_type(fs))