From 0525768a5be893d309917fbb527b1cf0589fdaa2 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 1 Oct 2013 16:07:50 +0200 Subject: [PATCH] fsck: don't print warning if there is no /etc/fstab at all MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Reported-by: Thomas Bächler Signed-off-by: Karel Zak --- disk-utils/fsck.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) 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); + } } } -- 2.47.3