summaryrefslogtreecommitdiffstats
path: root/disk-utils/fsck.c
diff options
context:
space:
mode:
authorKarel Zak2013-10-01 16:07:50 +0200
committerKarel Zak2013-10-01 16:07:50 +0200
commit0525768a5be893d309917fbb527b1cf0589fdaa2 (patch)
tree64216a8bf067e704c7264d0551cc2b0f6e830892 /disk-utils/fsck.c
parentlosetup: don't require 512-byte aligned offsets (diff)
downloadkernel-qcow2-util-linux-0525768a5be893d309917fbb527b1cf0589fdaa2.tar.gz
kernel-qcow2-util-linux-0525768a5be893d309917fbb527b1cf0589fdaa2.tar.xz
kernel-qcow2-util-linux-0525768a5be893d309917fbb527b1cf0589fdaa2.zip
fsck: don't print warning if there is no /etc/fstab at all
Reported-by: Thomas Bächler <thomas@archlinux.org> Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'disk-utils/fsck.c')
-rw-r--r--disk-utils/fsck.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/disk-utils/fsck.c b/disk-utils/fsck.c
index 1d05faf54..19eabe349 100644
--- a/disk-utils/fsck.c
+++ b/disk-utils/fsck.c
@@ -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);
+ }
}
}