]> err.no Git - util-linux/commitdiff
lib: [ismounted] don't wast time with mtab is /proc/mounts used
authorKarel Zak <kzak@redhat.com>
Thu, 18 Nov 2010 20:03:02 +0000 (21:03 +0100)
committerKarel Zak <kzak@redhat.com>
Wed, 24 Nov 2010 16:08:26 +0000 (17:08 +0100)
Signed-off-by: Karel Zak <kzak@redhat.com>
lib/ismounted.c

index 592df30863392c7e63f80a72219f85e069031550..f19d67b1e6ece5d3209ade624f2ba8605c69f3dc 100644 (file)
@@ -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