From 8c9e72ce2b3dc8cbc9df446b8915ea936cb702b3 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Thu, 18 Nov 2010 21:03:02 +0100 Subject: [PATCH] lib: [ismounted] don't wast time with mtab is /proc/mounts used Signed-off-by: Karel Zak --- lib/ismounted.c | 4 ++++ 1 file changed, 4 insertions(+) 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 -- 2.39.5