From: Karel Zak Date: Thu, 18 Nov 2010 20:03:02 +0000 (+0100) Subject: lib: [ismounted] don't wast time with mtab is /proc/mounts used X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=8c9e72ce2b3dc8cbc9df446b8915ea936cb702b3;p=util-linux lib: [ismounted] don't wast time with mtab is /proc/mounts used Signed-off-by: Karel Zak --- diff --git a/lib/ismounted.c b/lib/ismounted.c index 592df308..f19d67b1 100644 --- a/lib/ismounted.c +++ b/lib/ismounted.c @@ -171,6 +171,10 @@ static int check_mntent(const char *file, int *mount_flags, mtpt, mtlen); if (retval == 0 && (*mount_flags != 0)) return 0; + if (access("/proc/mounts", R_OK) == 0) { + *mount_flags = 0; + return retval; + } #endif /* __linux__ */ #if defined(MOUNTED) || defined(_PATH_MOUNTED) #ifndef MOUNTED