From: Karel Zak Date: Tue, 1 Oct 2013 14:07:50 +0000 (+0200) Subject: fsck: don't print warning if there is no /etc/fstab at all X-Git-Tag: v2.24-rc2~78 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0525768a5be893d309917fbb527b1cf0589fdaa2;p=thirdparty%2Futil-linux.git fsck: don't print warning if there is no /etc/fstab at all Reported-by: Thomas Bächler Signed-off-by: Karel Zak --- diff --git a/disk-utils/fsck.c b/disk-utils/fsck.c index 1d05faf549..19eabe349a 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); + } } }