]> Savannah Git Hosting - gnulib.git/commitdiff
mountlist: Port better to Android.
authorBruno Haible <bruno@clisp.org>
Sat, 26 Jan 2019 21:49:57 +0000 (22:49 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 26 Jan 2019 21:49:57 +0000 (22:49 +0100)
* lib/mountlist.c (MOUNTED): Redefine on Android.
* m4/ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS): Redefine MOUNTED on
Android.

ChangeLog
lib/mountlist.c
m4/ls-mntd-fs.m4

index 97834d681cb6eb1e26c09391647a47e5e947819d..69b13b46db484332f8d6806fb658746857515efb 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2019-01-26  Bruno Haible  <bruno@clisp.org>
+
+       mountlist: Port better to Android.
+       * lib/mountlist.c (MOUNTED): Redefine on Android.
+       * m4/ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS): Redefine MOUNTED on
+       Android.
+
 2019-01-26  Bruno Haible  <bruno@clisp.org>
 
        striconveh: Fix use of uninitialized iconv_t.
index 0528d8a70f00d65ca2726d6296b045e9e9906c68..937b3bb7617dad8c39d2e6b36b1b1777ae9c0790 100644 (file)
                                    also (obsolete) 4.3BSD, SunOS */
 # include <mntent.h>
 # include <sys/types.h>
-# if !defined MOUNTED
+# if defined __ANDROID__        /* Android */
+   /* Bionic versions from between 2014-01-09 and 2015-01-08 define MOUNTED to
+      an incorrect value; older Bionic versions don't define it at all.  */
+#  undef MOUNTED
+#  define MOUNTED "/proc/mounts"
+# elif !defined MOUNTED
 #  if defined _PATH_MOUNTED     /* GNU libc  */
 #   define MOUNTED _PATH_MOUNTED
 #  endif
index 2de7b71be61c8d678cf95bdf4373da90220d69e6..ba3843927192b7020fa119fc9a8df08871bfcf6e 100644 (file)
@@ -1,4 +1,4 @@
-# serial 36
+# serial 37
 # How to list mounted file systems.
 
 # Copyright (C) 1998-2004, 2006, 2009-2019 Free Software Foundation, Inc.
@@ -99,11 +99,14 @@ $ac_includes_default
 #include <stdio.h>
 
 #include <mntent.h>
-#if !defined MOUNTED
-# if defined _PATH_MOUNTED      /* GNU libc  */
+#if defined __ANDROID__        /* Android */
+# undef MOUNTED
+# define MOUNTED "/proc/mounts"
+#elif !defined MOUNTED
+# if defined _PATH_MOUNTED     /* GNU libc  */
 #  define MOUNTED _PATH_MOUNTED
 # endif
-# if defined MNT_MNTTAB /* HP-UX.  */
+# if defined MNT_MNTTAB        /* HP-UX.  */
 #  define MOUNTED MNT_MNTTAB
 # endif
 #endif