]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
fsck: don't print warning if there is no /etc/fstab at all
authorKarel Zak <kzak@redhat.com>
Tue, 1 Oct 2013 14:07:50 +0000 (16:07 +0200)
committerKarel Zak <kzak@redhat.com>
Tue, 1 Oct 2013 14:07:50 +0000 (16:07 +0200)
Reported-by: Thomas Bächler <thomas@archlinux.org>
Signed-off-by: Karel Zak <kzak@redhat.com>
disk-utils/fsck.c

index 1d05faf549f1898807453d2c91fbc0b588ac8311..19eabe349a88d105365e2576f95561f6a2a9dc41 100644 (file)
@@ -440,10 +440,14 @@ static void load_fs_info(void)
        if (mnt_table_parse_fstab(fstab, path)) {
                if (!path)
                        path = mnt_get_fstab_path();
-               if (errno)
-                       warn(_("%s: failed to parse fstab"), path);
-               else
-                       warnx(_("%s: failed to parse fstab"), path);
+
+               /* don't print error when there is no fstab at all */
+               if (access(path, F_OK) == 0) {
+                       if (errno)
+                               warn(_("%s: failed to parse fstab"), path);
+                       else
+                               warnx(_("%s: failed to parse fstab"), path);
+               }
        }
 }