summaryrefslogtreecommitdiff
path: root/monitor
diff options
context:
space:
mode:
authorOndrej Holy <oholy@redhat.com>2018-12-07 12:02:51 +0100
committerOndrej Holy <oholy@redhat.com>2018-12-07 12:24:01 +0000
commita041512cf791e8a827b94e805f8bdf192af977a2 (patch)
treeaab8c1c8ab04316fc87cc384fb597354a80e143f /monitor
parentab82d984e7961516cd36d5c5e3450897f44cc46f (diff)
downloadgvfs-a041512cf791e8a827b94e805f8bdf192af977a2.tar.gz
build: Use g_unix_mount_get_root_path conditionally
GLib hasn't been released with g_unix_mount_get_root_path support yet, so let's add macros to use this functionality only if available.
Diffstat (limited to 'monitor')
-rw-r--r--monitor/udisks2/gvfsudisks2volumemonitor.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/monitor/udisks2/gvfsudisks2volumemonitor.c b/monitor/udisks2/gvfsudisks2volumemonitor.c
index 2b2285f9..0a5ce96e 100644
--- a/monitor/udisks2/gvfsudisks2volumemonitor.c
+++ b/monitor/udisks2/gvfsudisks2volumemonitor.c
@@ -760,7 +760,11 @@ should_include_volume_check_mount_points (GVfsUDisks2VolumeMonitor *monitor,
mount_entry = g_unix_mount_at (mount_point, NULL);
if (mount_entry != NULL)
{
- const gchar *root = g_unix_mount_get_root_path (mount_entry);
+ const gchar *root = NULL;
+
+#ifdef HAVE_G_UNIX_MOUNT_GET_ROOT_PATH
+ root = g_unix_mount_get_root_path (mount_entry);
+#endif
if ((root == NULL || g_strcmp0 (root, "/") == 0) &&
should_include_mount (monitor, mount_entry))
@@ -1709,7 +1713,11 @@ update_mounts (GVfsUDisks2VolumeMonitor *monitor,
for (l = added; l != NULL; l = l->next)
{
GUnixMountEntry *mount_entry = l->data;
- const gchar *root = g_unix_mount_get_root_path (mount_entry);
+ const gchar *root = NULL;
+
+#ifdef HAVE_G_UNIX_MOUNT_GET_ROOT_PATH
+ root = g_unix_mount_get_root_path (mount_entry);
+#endif
volume = NULL;
if (root == NULL || g_strcmp0 (root, "/") == 0)
@@ -1745,7 +1753,11 @@ update_mounts (GVfsUDisks2VolumeMonitor *monitor,
}
if (gvfs_udisks2_mount_get_volume (mount) == NULL)
{
- const gchar *root = g_unix_mount_get_root_path (mount_entry);
+ const gchar *root = NULL;
+
+#ifdef HAVE_G_UNIX_MOUNT_GET_ROOT_PATH
+ root = g_unix_mount_get_root_path (mount_entry);
+#endif
volume = NULL;
if (root == NULL || g_strcmp0 (root, "/") == 0)