OSDN Git Service

Android: avoid the second check_mntent_file() android-x86-8.1-r2
authorChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 25 Jan 2019 09:22:43 +0000 (17:22 +0800)
committerChih-Wei Huang <cwhuang@linux.org.tw>
Fri, 25 Jan 2019 09:22:43 +0000 (17:22 +0800)
It's usually used to check /etc/mtab but Android doesn't have the file.
The second check is unnecessary.

lib/ext2fs/ismounted.c

index 7d52471..cbe7793 100644 (file)
@@ -244,7 +244,7 @@ static errcode_t check_mntent(const char *file, int *mount_flags,
        if (retval == 0 && (*mount_flags != 0))
                return 0;
 #endif /* __linux__ */
-#if defined(MOUNTED) || defined(_PATH_MOUNTED)
+#if !defined(ANDROID) && (defined(MOUNTED) || defined(_PATH_MOUNTED))
 #ifndef MOUNTED
 #define MOUNTED _PATH_MOUNTED
 #endif /* MOUNTED */