mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-14 00:06:24 +01:00
Use libmount to find the path of the fstab file
https://bugzilla.gnome.org/show_bug.cgi?id=522053
This commit is contained in:
parent
4f9cddaeb8
commit
8d5cf2df10
@ -150,6 +150,9 @@ static guint64 mount_poller_time = 0;
|
|||||||
|
|
||||||
#ifdef HAVE_MNTENT_H
|
#ifdef HAVE_MNTENT_H
|
||||||
#include <mntent.h>
|
#include <mntent.h>
|
||||||
|
#ifdef HAVE_LIBMOUNT
|
||||||
|
#include <libmount/libmount.h>
|
||||||
|
#endif
|
||||||
#elif defined (HAVE_SYS_MNTTAB_H)
|
#elif defined (HAVE_SYS_MNTTAB_H)
|
||||||
#include <sys/mnttab.h>
|
#include <sys/mnttab.h>
|
||||||
#endif
|
#endif
|
||||||
@ -728,6 +731,9 @@ _g_get_unix_mounts (void)
|
|||||||
static char *
|
static char *
|
||||||
get_fstab_file (void)
|
get_fstab_file (void)
|
||||||
{
|
{
|
||||||
|
#ifdef HAVE_LIBMOUNT
|
||||||
|
return (char *) mnt_get_fstab_path ();
|
||||||
|
#else
|
||||||
#if defined(HAVE_SYS_MNTCTL_H) && defined(HAVE_SYS_VMOUNT_H) && defined(HAVE_SYS_VFS_H)
|
#if defined(HAVE_SYS_MNTCTL_H) && defined(HAVE_SYS_VMOUNT_H) && defined(HAVE_SYS_VFS_H)
|
||||||
/* AIX */
|
/* AIX */
|
||||||
return "/etc/filesystems";
|
return "/etc/filesystems";
|
||||||
@ -738,6 +744,7 @@ get_fstab_file (void)
|
|||||||
#else
|
#else
|
||||||
return "/etc/fstab";
|
return "/etc/fstab";
|
||||||
#endif
|
#endif
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
/* mntent.h (Linux, GNU, NSS) {{{2 */
|
/* mntent.h (Linux, GNU, NSS) {{{2 */
|
||||||
|
Loading…
Reference in New Issue
Block a user