[glib] Use libmount to find the path of the fstab file
- From: Mario Sanchez Prada <msanchez src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib] Use libmount to find the path of the fstab file
- Date: Tue, 26 Jul 2016 14:17:27 +0000 (UTC)
commit 8d5cf2df102117607f65714a9c49a579ebedaa9b
Author: Mario Sanchez Prada <mario endlessm com>
Date: Tue Jul 19 11:51:55 2016 +0100
Use libmount to find the path of the fstab file
https://bugzilla.gnome.org/show_bug.cgi?id=522053
gio/gunixmounts.c | 7 +++++++
1 files changed, 7 insertions(+), 0 deletions(-)
---
diff --git a/gio/gunixmounts.c b/gio/gunixmounts.c
index 1e0d6c5..fc53ed5 100644
--- a/gio/gunixmounts.c
+++ b/gio/gunixmounts.c
@@ -150,6 +150,9 @@ static guint64 mount_poller_time = 0;
#ifdef HAVE_MNTENT_H
#include <mntent.h>
+#ifdef HAVE_LIBMOUNT
+#include <libmount/libmount.h>
+#endif
#elif defined (HAVE_SYS_MNTTAB_H)
#include <sys/mnttab.h>
#endif
@@ -728,6 +731,9 @@ _g_get_unix_mounts (void)
static char *
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)
/* AIX */
return "/etc/filesystems";
@@ -738,6 +744,7 @@ get_fstab_file (void)
#else
return "/etc/fstab";
#endif
+#endif
}
/* mntent.h (Linux, GNU, NSS) {{{2 */
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]