Sync with gnulib 74c29c68bba3fe7c2f02eb3fc9f7ef196cec1bc6.

mountlist: Modernize platform lists.

* m4.include/gnulib/ls-mntd-fs.m4: Clarify which MOUNTED_* symbol
  applies to which platforms, deemphasizing the obsolete ones.
* src/filemanager/filegui.c: Likewise.
* src/filemanager/mountlist.c: Likewise.

Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
Andrew Borodin 2018-10-14 11:23:46 +03:00
parent 1182dbdd93
commit 849bfb26f8
3 changed files with 43 additions and 38 deletions

View File

@ -76,7 +76,7 @@ AC_FUNC_GETMNTENT
# function named listmntent to risk the false positive. # function named listmntent to risk the false positive.
if test -z "$ac_list_mounted_fs"; then if test -z "$ac_list_mounted_fs"; then
# Cray UNICOS 9 # (obsolete) Cray UNICOS 9
AC_MSG_CHECKING([for listmntent of Cray/Unicos-9]) AC_MSG_CHECKING([for listmntent of Cray/Unicos-9])
AC_CACHE_VAL([fu_cv_sys_mounted_cray_listmntent], AC_CACHE_VAL([fu_cv_sys_mounted_cray_listmntent],
[fu_cv_sys_mounted_cray_listmntent=no [fu_cv_sys_mounted_cray_listmntent=no
@ -121,7 +121,7 @@ if test $ac_cv_func_getmntent = yes; then
# Determine whether it's the one-argument variant or the two-argument one. # Determine whether it's the one-argument variant or the two-argument one.
if test -z "$ac_list_mounted_fs"; then if test -z "$ac_list_mounted_fs"; then
# GNU/Linux, 4.3BSD, SunOS, HP-UX, Dynix, Irix # glibc, HP-UX, IRIX, Cygwin, Android, also (obsolete) 4.3BSD, SunOS, Dynix.
AC_MSG_CHECKING([for one-argument getmntent function]) AC_MSG_CHECKING([for one-argument getmntent function])
AC_CACHE_VAL([fu_cv_sys_mounted_getmntent1], AC_CACHE_VAL([fu_cv_sys_mounted_getmntent1],
[AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[ [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
@ -157,7 +157,7 @@ if test $ac_cv_func_getmntent = yes; then
fi fi
if test -z "$ac_list_mounted_fs"; then if test -z "$ac_list_mounted_fs"; then
# SVR4 # Solaris, also (obsolete) SVR4.
AC_MSG_CHECKING([for two-argument getmntent function]) AC_MSG_CHECKING([for two-argument getmntent function])
AC_CACHE_VAL([fu_cv_sys_mounted_getmntent2], AC_CACHE_VAL([fu_cv_sys_mounted_getmntent2],
[AC_EGREP_HEADER([getmntent], [sys/mnttab.h], [AC_EGREP_HEADER([getmntent], [sys/mnttab.h],
@ -176,7 +176,7 @@ if test $ac_cv_func_getmntent = yes; then
fi fi
if test -z "$ac_list_mounted_fs"; then if test -z "$ac_list_mounted_fs"; then
# DEC Alpha running OSF/1, and Apple Darwin 1.3. # OSF/1, also (obsolete) Apple Darwin 1.3.
# powerpc-apple-darwin1.3.7 needs sys/param.h sys/ucred.h sys/fs_types.h # powerpc-apple-darwin1.3.7 needs sys/param.h sys/ucred.h sys/fs_types.h
AC_MSG_CHECKING([for getfsstat function]) AC_MSG_CHECKING([for getfsstat function])
@ -205,7 +205,7 @@ $getfsstat_includes]]
fi fi
if test -z "$ac_list_mounted_fs"; then if test -z "$ac_list_mounted_fs"; then
# SVR3 # (obsolete) SVR3
AC_MSG_CHECKING([for FIXME existence of three headers]) AC_MSG_CHECKING([for FIXME existence of three headers])
AC_CACHE_VAL([fu_cv_sys_mounted_fread_fstyp], AC_CACHE_VAL([fu_cv_sys_mounted_fread_fstyp],
[AC_PREPROC_IFELSE([AC_LANG_SOURCE([[ [AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
@ -225,7 +225,8 @@ if test -z "$ac_list_mounted_fs"; then
fi fi
if test -z "$ac_list_mounted_fs"; then if test -z "$ac_list_mounted_fs"; then
# 4.4BSD and DEC OSF/1. # Mac OS X, FreeBSD, NetBSD, OpenBSD, also (obsolete) 4.4BSD.
# OSF/1 also has getmntinfo but is already handled above.
AC_MSG_CHECKING([for getmntinfo function]) AC_MSG_CHECKING([for getmntinfo function])
AC_CACHE_VAL([fu_cv_sys_mounted_getmntinfo], AC_CACHE_VAL([fu_cv_sys_mounted_getmntinfo],
[ [
@ -260,12 +261,14 @@ int getmntinfo (struct statfs **, int);
]) ])
AC_MSG_RESULT([$fu_cv_sys_mounted_getmntinfo2]) AC_MSG_RESULT([$fu_cv_sys_mounted_getmntinfo2])
if test $fu_cv_sys_mounted_getmntinfo2 = no; then if test $fu_cv_sys_mounted_getmntinfo2 = no; then
# Mac OS X, FreeBSD, OpenBSD, also (obsolete) 4.4BSD.
ac_list_mounted_fs=found ac_list_mounted_fs=found
AC_DEFINE([MOUNTED_GETMNTINFO], [1], AC_DEFINE([MOUNTED_GETMNTINFO], [1],
[Define if there is a function named getmntinfo for reading the [Define if there is a function named getmntinfo for reading the
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.
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
@ -276,7 +279,7 @@ int getmntinfo (struct statfs **, int);
fi fi
if test -z "$ac_list_mounted_fs"; then if test -z "$ac_list_mounted_fs"; then
# Ultrix # (obsolete) Ultrix.
AC_MSG_CHECKING([for getmnt function]) AC_MSG_CHECKING([for getmnt function])
AC_CACHE_VAL([fu_cv_sys_mounted_getmnt], AC_CACHE_VAL([fu_cv_sys_mounted_getmnt],
[AC_PREPROC_IFELSE([AC_LANG_SOURCE([[ [AC_PREPROC_IFELSE([AC_LANG_SOURCE([[
@ -294,7 +297,7 @@ if test -z "$ac_list_mounted_fs"; then
fi fi
if test -z "$ac_list_mounted_fs"; then if test -z "$ac_list_mounted_fs"; then
# BeOS # Haiku, also (obsolete) BeOS.
AC_CHECK_FUNCS([next_dev fs_stat_dev]) AC_CHECK_FUNCS([next_dev fs_stat_dev])
AC_CHECK_HEADERS([fs_info.h]) AC_CHECK_HEADERS([fs_info.h])
AC_MSG_CHECKING([for BEOS mounted file system support functions]) AC_MSG_CHECKING([for BEOS mounted file system support functions])
@ -315,7 +318,7 @@ if test -z "$ac_list_mounted_fs"; then
fi fi
if test -z "$ac_list_mounted_fs"; then if test -z "$ac_list_mounted_fs"; then
# SVR2 # (obsolete) SVR2.
AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab]) AC_MSG_CHECKING([whether it is possible to resort to fread on /etc/mnttab])
AC_CACHE_VAL([fu_cv_sys_mounted_fread], AC_CACHE_VAL([fu_cv_sys_mounted_fread],
[AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <mnttab.h>]])], [AC_PREPROC_IFELSE([AC_LANG_SOURCE([[#include <mnttab.h>]])],

View File

@ -84,7 +84,7 @@
#include <nfs/nfs_clnt.h> #include <nfs/nfs_clnt.h>
#include <nfs/vfs.h> #include <nfs/vfs.h>
#endif #endif
#elif defined HAVE_OS_H /* BeOS */ #elif defined HAVE_OS_H /* Haiku, also (obsolete) BeOS */
#include <fs_info.h> #include <fs_info.h>
#endif #endif
@ -106,7 +106,7 @@
#else #else
#define STATFS statfs #define STATFS statfs
#define STRUCT_STATVFS struct statfs #define STRUCT_STATVFS struct statfs
#ifdef HAVE_OS_H /* BeOS */ #ifdef HAVE_OS_H /* Haiku, also (obsolete) BeOS */
/* BeOS has a statvfs function, but it does not return sensible values /* BeOS has a statvfs function, but it does not return sensible values
for f_files, f_ffree and f_favail, and lacks f_type, f_basetype and for f_files, f_ffree and f_favail, and lacks f_type, f_basetype and
f_fstypename. Use 'struct fs_info' instead. */ f_fstypename. Use 'struct fs_info' instead. */
@ -138,7 +138,7 @@ statfs (char const *filename, struct fs_info *buf)
#else #else
#if defined HAVE_STRUCT_STATVFS_F_FSTYPENAME || defined HAVE_STRUCT_STATFS_F_FSTYPENAME #if defined HAVE_STRUCT_STATVFS_F_FSTYPENAME || defined HAVE_STRUCT_STATFS_F_FSTYPENAME
#define STATXFS_FILE_SYSTEM_TYPE_MEMBER_NAME f_fstypename #define STATXFS_FILE_SYSTEM_TYPE_MEMBER_NAME f_fstypename
#elif defined HAVE_OS_H /* BeOS */ #elif defined HAVE_OS_H /* Haiku, also (obsolete) BeOS */
#define STATXFS_FILE_SYSTEM_TYPE_MEMBER_NAME fsh_name #define STATXFS_FILE_SYSTEM_TYPE_MEMBER_NAME fsh_name
#endif #endif
#endif #endif

View File

@ -49,7 +49,7 @@
#include <unistd.h> #include <unistd.h>
#include <sys/stat.h> #include <sys/stat.h>
#ifdef MOUNTED_GETFSSTAT /* OSF_1 and Darwin1.3.x */ #ifdef MOUNTED_GETFSSTAT /* OSF_1, also (obsolete) Apple Darwin 1.3 */
#ifdef HAVE_SYS_UCRED_H #ifdef HAVE_SYS_UCRED_H
#include <grp.h> /* needed on OSF V4.0 for definition of NGROUPS, #include <grp.h> /* needed on OSF V4.0 for definition of NGROUPS,
NGROUPS is used as an array dimension in ucred.h */ NGROUPS is used as an array dimension in ucred.h */
@ -82,7 +82,8 @@
#include <sys/dustat.h> #include <sys/dustat.h>
#endif #endif
#ifdef MOUNTED_GETMNTENT1 /* 4.3BSD, SunOS, HP-UX, Dynix, Irix. */ #ifdef MOUNTED_GETMNTENT1 /* glibc, HP-UX, IRIX, Cygwin, Android,
also (obsolete) 4.3BSD, SunOS, Dynix */
#include <mntent.h> #include <mntent.h>
#include <sys/types.h> #include <sys/types.h>
#ifndef MOUNTED #ifndef MOUNTED
@ -98,44 +99,44 @@
#endif #endif
#endif #endif
#ifdef MOUNTED_GETMNTINFO /* 4.4BSD. */ #ifdef MOUNTED_GETMNTINFO /* Mac OS X, FreeBSD, OpenBSD, also (obsolete) 4.4BSD */
#include <sys/mount.h> #include <sys/mount.h>
#endif #endif
#ifdef MOUNTED_GETMNTINFO2 /* NetBSD 3.0. */ #ifdef MOUNTED_GETMNTINFO2 /* NetBSD */
#include <sys/statvfs.h> #include <sys/statvfs.h>
#endif #endif
#ifdef MOUNTED_GETMNT /* Ultrix. */ #ifdef MOUNTED_GETMNT /* (obsolete) Ultrix */
#include <sys/mount.h> #include <sys/mount.h>
#include <sys/fs_types.h> #include <sys/fs_types.h>
#endif #endif
#ifdef MOUNTED_FS_STAT_DEV /* BeOS. */ #ifdef MOUNTED_FS_STAT_DEV /* Haiku, also (obsolete) BeOS */
#include <fs_info.h> #include <fs_info.h>
#include <dirent.h> #include <dirent.h>
#endif #endif
#ifdef MOUNTED_FREAD_FSTYP /* SVR3. */ #ifdef MOUNTED_FREAD_FSTYP /* (obsolete) SVR3 */
#include <mnttab.h> #include <mnttab.h>
#include <sys/fstyp.h> #include <sys/fstyp.h>
#include <sys/statfs.h> #include <sys/statfs.h>
#endif #endif
#ifdef MOUNTED_LISTMNTENT #ifdef MOUNTED_LISTMNTENT /* (obsolete) Cray UNICOS 9 */
#include <mntent.h> #include <mntent.h>
#endif #endif
#ifdef MOUNTED_GETMNTENT2 /* SVR4. */ #ifdef MOUNTED_GETMNTENT2 /* Solaris, also (obsolete) SVR4 */
#include <sys/mnttab.h> #include <sys/mnttab.h>
#endif #endif
#ifdef MOUNTED_VMOUNT /* AIX. */ #ifdef MOUNTED_VMOUNT /* AIX */
#include <fshelp.h> #include <fshelp.h>
#include <sys/vfs.h> #include <sys/vfs.h>
#endif #endif
#ifdef MOUNTED_INTERIX_STATVFS /* Interix. */ #ifdef MOUNTED_INTERIX_STATVFS /* Interix */
#include <sys/statvfs.h> #include <sys/statvfs.h>
#include <dirent.h> #include <dirent.h>
#endif #endif
@ -377,7 +378,7 @@ free_mount_entry (struct mount_entry *me)
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
#ifdef MOUNTED_GETMNTINFO #ifdef MOUNTED_GETMNTINFO /* Mac OS X, FreeBSD, OpenBSD, also (obsolete) 4.4BSD */
#ifndef HAVE_STRUCT_STATFS_F_FSTYPENAME #ifndef HAVE_STRUCT_STATFS_F_FSTYPENAME
static char * static char *
@ -511,7 +512,7 @@ fsp_to_string (const struct statfs *fsp)
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
#ifdef MOUNTED_VMOUNT /* AIX. */ #ifdef MOUNTED_VMOUNT /* AIX */
static char * static char *
fstype_to_string (int t) fstype_to_string (int t)
{ {
@ -595,7 +596,7 @@ statfs (char *file, struct statfs *fsb)
/* --------------------------------------------------------------------------------------------- */ /* --------------------------------------------------------------------------------------------- */
#if defined MOUNTED_GETMNTENT1 && defined __linux__ #if defined MOUNTED_GETMNTENT1 && defined __linux__ /* 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. */
@ -633,7 +634,7 @@ read_file_system_list (void)
GSList *mount_list = NULL; GSList *mount_list = NULL;
struct mount_entry *me; struct mount_entry *me;
#ifdef MOUNTED_LISTMNTENT #ifdef MOUNTED_LISTMNTENT /* (obsolete) Cray UNICOS 9 */
{ {
struct tabmntent *mntlist, *p; struct tabmntent *mntlist, *p;
@ -664,7 +665,8 @@ read_file_system_list (void)
} }
#endif #endif
#ifdef MOUNTED_GETMNTENT1 /* GNU/Linux, 4.3BSD, SunOS, HP-UX, Dynix, Irix. */ #ifdef MOUNTED_GETMNTENT1 /* glibc, HP-UX, IRIX, Cygwin, Android,
also (obsolete) 4.3BSD, SunOS, Dynix */
{ {
FILE *fp; FILE *fp;
@ -790,7 +792,7 @@ read_file_system_list (void)
} }
#endif /* MOUNTED_GETMNTENT1. */ #endif /* MOUNTED_GETMNTENT1. */
#ifdef MOUNTED_GETMNTINFO /* 4.4BSD. */ #ifdef MOUNTED_GETMNTINFO /* Mac OS X, FreeBSD, OpenBSD, also (obsolete) 4.4BSD */
{ {
struct statfs *fsp; struct statfs *fsp;
int entries; int entries;
@ -817,7 +819,7 @@ read_file_system_list (void)
} }
#endif /* MOUNTED_GETMNTINFO */ #endif /* MOUNTED_GETMNTINFO */
#ifdef MOUNTED_GETMNTINFO2 /* NetBSD 3.0. */ #ifdef MOUNTED_GETMNTINFO2 /* NetBSD */
{ {
struct statvfs *fsp; struct statvfs *fsp;
int entries; int entries;
@ -842,7 +844,7 @@ read_file_system_list (void)
} }
#endif /* MOUNTED_GETMNTINFO2 */ #endif /* MOUNTED_GETMNTINFO2 */
#ifdef MOUNTED_GETMNT /* Ultrix. */ #ifdef MOUNTED_GETMNT /* (obsolete) Ultrix */
{ {
int offset = 0; int offset = 0;
int val; int val;
@ -872,7 +874,7 @@ read_file_system_list (void)
} }
#endif /* MOUNTED_GETMNT. */ #endif /* MOUNTED_GETMNT. */
#if defined MOUNTED_FS_STAT_DEV /* BeOS */ #if defined MOUNTED_FS_STAT_DEV /* Haiku, also (obsolete) BeOS */
{ {
/* The next_dev() and fs_stat_dev() system calls give the list of /* The next_dev() and fs_stat_dev() system calls give the list of
all file systems, including the information returned by statvfs() all file systems, including the information returned by statvfs()
@ -972,7 +974,7 @@ read_file_system_list (void)
} }
#endif /* MOUNTED_FS_STAT_DEV */ #endif /* MOUNTED_FS_STAT_DEV */
#ifdef MOUNTED_GETFSSTAT /* __alpha running OSF_1 */ #ifdef MOUNTED_GETFSSTAT /* OSF/1, also (obsolete) Apple Darwin 1.3 */
{ {
int numsys, counter; int numsys, counter;
size_t bufsize; size_t bufsize;
@ -1016,7 +1018,7 @@ read_file_system_list (void)
} }
#endif /* MOUNTED_GETFSSTAT */ #endif /* MOUNTED_GETFSSTAT */
#if defined MOUNTED_FREAD || defined MOUNTED_FREAD_FSTYP /* SVR[23]. */ #if defined MOUNTED_FREAD || defined MOUNTED_FREAD_FSTYP /* (obsolete) SVR3 */
{ {
struct mnttab mnt; struct mnttab mnt;
char *table = "/etc/mnttab"; char *table = "/etc/mnttab";
@ -1073,7 +1075,7 @@ read_file_system_list (void)
} }
#endif /* MOUNTED_FREAD || MOUNTED_FREAD_FSTYP. */ #endif /* MOUNTED_FREAD || MOUNTED_FREAD_FSTYP. */
#ifdef MOUNTED_GETMNTTBL /* DolphinOS goes its own way. */ #ifdef MOUNTED_GETMNTTBL /* (obsolete) DolphinOS */
{ {
struct mntent **mnttbl = getmnttbl (), **ent; struct mntent **mnttbl = getmnttbl (), **ent;
@ -1095,7 +1097,7 @@ read_file_system_list (void)
} }
#endif #endif
#ifdef MOUNTED_GETMNTENT2 /* SVR4. */ #ifdef MOUNTED_GETMNTENT2 /* Solaris, also (obsolete) SVR4 */
{ {
struct mnttab mnt; struct mnttab mnt;
char *table = MNTTAB; char *table = MNTTAB;
@ -1168,7 +1170,7 @@ read_file_system_list (void)
} }
#endif /* MOUNTED_GETMNTENT2. */ #endif /* MOUNTED_GETMNTENT2. */
#ifdef MOUNTED_VMOUNT /* AIX. */ #ifdef MOUNTED_VMOUNT /* AIX */
{ {
int bufsize; int bufsize;
void *entries; void *entries;
@ -1233,7 +1235,7 @@ read_file_system_list (void)
} }
#endif /* MOUNTED_VMOUNT. */ #endif /* MOUNTED_VMOUNT. */
#ifdef MOUNTED_INTERIX_STATVFS #ifdef MOUNTED_INTERIX_STATVFS /* Interix */
{ {
DIR *dirp = opendir ("/dev/fs"); DIR *dirp = opendir ("/dev/fs");
char node[9 + NAME_MAX]; char node[9 + NAME_MAX];