Sync with gnulib d1327df1f1c9bae26571e6699800c8d1c4712afb.

mountlist: Add support for Minix.

* m4.include/gnulib/ls-mntd-fs.m4 (gl_LIST_MOUNTED_FILE_SYSTEMS): Don't
  use AC_CHECK_FUNCS to check for 'getmntinfo'.
* src/filemanager/mountlist.c: Update comments.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2018-10-14 11:57:37 +03:00
parent 5cf5a034ae
commit 6d593567d1
2 changed files with 26 additions and 9 deletions

View File

@ -28,7 +28,7 @@ AC_DEFUN([AC_FUNC_GETMNTENT],
AC_DEFUN([gl_LIST_MOUNTED_FILE_SYSTEMS], AC_DEFUN([gl_LIST_MOUNTED_FILE_SYSTEMS],
[ [
AC_REQUIRE([AC_CANONICAL_HOST]) AC_REQUIRE([AC_CANONICAL_HOST])
AC_CHECK_FUNCS([listmntent getmntinfo]) AC_CHECK_FUNCS([listmntent])
AC_CHECK_HEADERS_ONCE([sys/param.h sys/statvfs.h]) AC_CHECK_HEADERS_ONCE([sys/param.h sys/statvfs.h])
# We must include grp.h before ucred.h on OSF V4.0, since ucred.h uses # We must include grp.h before ucred.h on OSF V4.0, since ucred.h uses
@ -229,14 +229,31 @@ $getfsstat_includes
fi fi
if test -z "$ac_list_mounted_fs"; then if test -z "$ac_list_mounted_fs"; then
# Mac OS X, FreeBSD, NetBSD, OpenBSD, also (obsolete) 4.4BSD. # Mac OS X, FreeBSD, NetBSD, OpenBSD, Minix, also (obsolete) 4.4BSD.
# OSF/1 also has getmntinfo but is already handled above. # OSF/1 also has getmntinfo but is already handled above.
# We cannot use AC_CHECK_FUNCS([getmntinfo]) here, because at the linker
# level the function is sometimes called getmntinfo64 or getmntinfo$INODE64
# on Mac OS X, __getmntinfo13 on NetBSD and Minix, _F64_getmntinfo on OSF/1.
AC_CACHE_CHECK([for getmntinfo function], AC_CACHE_CHECK([for getmntinfo function],
[fu_cv_sys_mounted_getmntinfo], [fu_cv_sys_mounted_getmntinfo],
[ [AC_LINK_IFELSE(
test "$ac_cv_func_getmntinfo" = yes \ [AC_LANG_PROGRAM([[
&& fu_cv_sys_mounted_getmntinfo=yes \ #if HAVE_SYS_PARAM_H
|| fu_cv_sys_mounted_getmntinfo=no # include <sys/param.h>
#endif
#include <sys/types.h>
#if HAVE_SYS_MOUNT_H
# include <sys/mount.h>
#endif
#if HAVE_SYS_STATVFS_H
# include <sys/statvfs.h>
#endif
#include <stdlib.h>
]],
[[int count = getmntinfo (NULL, MNT_WAIT);
]])],
[fu_cv_sys_mounted_getmntinfo=yes],
[fu_cv_sys_mounted_getmntinfo=no])
]) ])
if test $fu_cv_sys_mounted_getmntinfo = yes; then if test $fu_cv_sys_mounted_getmntinfo = yes; then
AC_CACHE_CHECK([whether getmntinfo returns statvfs structures], AC_CACHE_CHECK([whether getmntinfo returns statvfs structures],
@ -270,7 +287,7 @@ int getmntinfo (struct statfs **, int);
list of mounted file systems and it returns an array of list of mounted file systems and it returns an array of
'struct statfs'. (4.4BSD, Darwin)]) 'struct statfs'. (4.4BSD, Darwin)])
else else
# NetBSD. # NetBSD, Minix.
ac_list_mounted_fs=found ac_list_mounted_fs=found
AC_DEFINE([MOUNTED_GETMNTINFO2], [1], AC_DEFINE([MOUNTED_GETMNTINFO2], [1],
[Define if there is a function named getmntinfo for reading the [Define if there is a function named getmntinfo for reading the

View File

@ -103,7 +103,7 @@
#include <sys/mount.h> #include <sys/mount.h>
#endif #endif
#ifdef MOUNTED_GETMNTINFO2 /* NetBSD */ #ifdef MOUNTED_GETMNTINFO2 /* NetBSD, Minix */
#include <sys/statvfs.h> #include <sys/statvfs.h>
#endif #endif
@ -819,7 +819,7 @@ read_file_system_list (void)
} }
#endif /* MOUNTED_GETMNTINFO */ #endif /* MOUNTED_GETMNTINFO */
#ifdef MOUNTED_GETMNTINFO2 /* NetBSD */ #ifdef MOUNTED_GETMNTINFO2 /* NetBSD, Minix */
{ {
struct statvfs *fsp; struct statvfs *fsp;
int entries; int entries;