# HG changeset patch # User Bruno Haible # Date 1548539397 -3600 # Node ID cdd46dde7e3447f1d1c1029b3a7470d6b054b3ee # Parent 648fa64e008cb670bf33e7744ad2f1af182cc1d5 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. diff -r 648fa64e008c -r cdd46dde7e34 ChangeLog --- a/ChangeLog Sat Jan 26 21:46:40 2019 +0100 +++ b/ChangeLog Sat Jan 26 22:49:57 2019 +0100 @@ -1,3 +1,10 @@ +2019-01-26 Bruno Haible + + 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 striconveh: Fix use of uninitialized iconv_t. diff -r 648fa64e008c -r cdd46dde7e34 lib/mountlist.c --- a/lib/mountlist.c Sat Jan 26 21:46:40 2019 +0100 +++ b/lib/mountlist.c Sat Jan 26 22:49:57 2019 +0100 @@ -66,7 +66,12 @@ also (obsolete) 4.3BSD, SunOS */ # include # include -# 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 diff -r 648fa64e008c -r cdd46dde7e34 m4/ls-mntd-fs.m4 --- a/m4/ls-mntd-fs.m4 Sat Jan 26 21:46:40 2019 +0100 +++ b/m4/ls-mntd-fs.m4 Sat Jan 26 22:49:57 2019 +0100 @@ -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 @@ #include #include -#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