mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
Sync with gnulib a3d1c7849936e481ae10dea5312a36a448a5d5bf.
src/filemanager/mountlist.c: use Linux code on Android. Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
5505ed054d
commit
1c621d1a86
@ -1,4 +1,4 @@
|
|||||||
# serial 37
|
# serial 38
|
||||||
# How to list mounted file systems.
|
# How to list mounted file systems.
|
||||||
|
|
||||||
# Copyright (C) 1998-2004, 2006, 2009-2018 Free Software Foundation, Inc.
|
# Copyright (C) 1998-2004, 2006, 2009-2018 Free Software Foundation, Inc.
|
||||||
@ -123,7 +123,7 @@ $ac_includes_default
|
|||||||
[Define if there is a function named getmntent for reading the list
|
[Define if there is a function named getmntent for reading the list
|
||||||
of mounted file systems, and that function takes a single argument.
|
of mounted file systems, and that function takes a single argument.
|
||||||
(4.3BSD, SunOS, HP-UX, Irix)])
|
(4.3BSD, SunOS, HP-UX, Irix)])
|
||||||
AC_CHECK_FUNCS([hasmntopt])
|
AC_CHECK_FUNCS([setmntent endmntent hasmntopt])
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
@ -140,6 +140,15 @@
|
|||||||
#include <sys/mntent.h>
|
#include <sys/mntent.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef MOUNTED_GETMNTENT1
|
||||||
|
#if !HAVE_SETMNTENT /* Android <= 4.4 */
|
||||||
|
#define setmntent(fp,mode) fopen (fp, mode)
|
||||||
|
#endif
|
||||||
|
#if !HAVE_ENDMNTENT /* Android <= 4.4 */
|
||||||
|
#define endmntent(fp) fclose (fp)
|
||||||
|
#endif
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef HAVE_HASMNTOPT
|
#ifndef HAVE_HASMNTOPT
|
||||||
#define hasmntopt(mnt, opt) ((char *) 0)
|
#define hasmntopt(mnt, opt) ((char *) 0)
|
||||||
#endif
|
#endif
|
||||||
@ -555,7 +564,7 @@ dev_from_mount_options (char const *mount_options)
|
|||||||
|
|
||||||
/* --------------------------------------------------------------------------------------------- */
|
/* --------------------------------------------------------------------------------------------- */
|
||||||
|
|
||||||
#if defined MOUNTED_GETMNTENT1 && defined __linux__ /* GNU/Linux, Android */
|
#if defined MOUNTED_GETMNTENT1 && (defined __linux__ || defined __ANDROID__) /* GNU/Linux, Android */
|
||||||
|
|
||||||
/* Unescape the paths in mount tables.
|
/* Unescape the paths in mount tables.
|
||||||
STR is updated in place. */
|
STR is updated in place. */
|
||||||
@ -598,7 +607,7 @@ read_file_system_list (void)
|
|||||||
{
|
{
|
||||||
FILE *fp;
|
FILE *fp;
|
||||||
|
|
||||||
#ifdef __linux__
|
#if defined __linux__ || defined __ANDROID__
|
||||||
/* Try parsing mountinfo first, as that make device IDs available.
|
/* Try parsing mountinfo first, as that make device IDs available.
|
||||||
Note we could use libmount routines to simplify this parsing a little
|
Note we could use libmount routines to simplify this parsing a little
|
||||||
(and that code is in previous versions of this function), however
|
(and that code is in previous versions of this function), however
|
||||||
@ -686,7 +695,7 @@ read_file_system_list (void)
|
|||||||
goto free_then_fail;
|
goto free_then_fail;
|
||||||
}
|
}
|
||||||
else /* fallback to /proc/self/mounts (/etc/mtab). */
|
else /* fallback to /proc/self/mounts (/etc/mtab). */
|
||||||
#endif /* __linux __ */
|
#endif /* __linux __ || __ANDROID__ */
|
||||||
{
|
{
|
||||||
struct mntent *mnt;
|
struct mntent *mnt;
|
||||||
const char *table = MOUNTED;
|
const char *table = MOUNTED;
|
||||||
|
Loading…
Reference in New Issue
Block a user