summaryrefslogtreecommitdiffstats
path: root/lib/ismounted.c
diff options
context:
space:
mode:
authorKarel Zak2010-11-18 21:03:02 +0100
committerKarel Zak2010-11-24 17:08:26 +0100
commit8c9e72ce2b3dc8cbc9df446b8915ea936cb702b3 (patch)
tree97e4f1dcd6ac96e6aebebfb1df7eb526d3c3bd2b /lib/ismounted.c
parentlibblkid: remove unused variable (diff)
downloadkernel-qcow2-util-linux-8c9e72ce2b3dc8cbc9df446b8915ea936cb702b3.tar.gz
kernel-qcow2-util-linux-8c9e72ce2b3dc8cbc9df446b8915ea936cb702b3.tar.xz
kernel-qcow2-util-linux-8c9e72ce2b3dc8cbc9df446b8915ea936cb702b3.zip
lib: [ismounted] don't wast time with mtab is /proc/mounts used
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'lib/ismounted.c')
-rw-r--r--lib/ismounted.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/ismounted.c b/lib/ismounted.c
index 592df3086..f19d67b1e 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