summaryrefslogtreecommitdiffstats
path: root/fsck/fsck.c
diff options
context:
space:
mode:
authorKarel Zak2012-02-20 22:22:58 +0100
committerKarel Zak2012-03-20 11:22:09 +0100
commit7064679f57d195974b42b680cea940c2f2756859 (patch)
tree03e51fc4464da836eff871ed6904d03839b7b5ac /fsck/fsck.c
parentfsck: fix coding style (diff)
downloadkernel-qcow2-util-linux-7064679f57d195974b42b680cea940c2f2756859.tar.gz
kernel-qcow2-util-linux-7064679f57d195974b42b680cea940c2f2756859.tar.xz
kernel-qcow2-util-linux-7064679f57d195974b42b680cea940c2f2756859.zip
fsck: don't try to call fsck for undefined fs type
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'fsck/fsck.c')
-rw-r--r--fsck/fsck.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/fsck/fsck.c b/fsck/fsck.c
index ceaa5a62c..0945c5820 100644
--- a/fsck/fsck.c
+++ b/fsck/fsck.c
@@ -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))