diff options
author | Ondrej Holy <oholy@redhat.com> | 2018-12-07 12:02:51 +0100 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2018-12-07 12:24:01 +0000 |
commit | a041512cf791e8a827b94e805f8bdf192af977a2 (patch) | |
tree | aab8c1c8ab04316fc87cc384fb597354a80e143f /monitor | |
parent | ab82d984e7961516cd36d5c5e3450897f44cc46f (diff) | |
download | gvfs-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.c | 18 |
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) |