From 0525768a5be893d309917fbb527b1cf0589fdaa2 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Tue, 1 Oct 2013 16:07:50 +0200 Subject: fsck: don't print warning if there is no /etc/fstab at all Reported-by: Thomas Bächler Signed-off-by: Karel Zak --- disk-utils/fsck.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'disk-utils/fsck.c') 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); + } } } -- cgit v1.2.3-55-g7522