diff options
author | Ondrej Holy <oholy@redhat.com> | 2020-06-23 08:33:11 +0200 |
---|---|---|
committer | Ondrej Holy <oholy@redhat.com> | 2020-08-05 13:57:18 +0000 |
commit | 077abad24355846fb8d77c2f3be2673010629f74 (patch) | |
tree | 47e5abff5e4cae29bdd4a37548d7d2789b2d4547 | |
parent | f93bd46c36c8e42f17f0f61b79c55a3794906395 (diff) | |
download | gvfs-077abad24355846fb8d77c2f3be2673010629f74.tar.gz |
udisks2: Replace custom code by g_unix_mount_point_at
The newly introduced g_unix_mount_point_at can be used to replace
custom code.
-rw-r--r-- | monitor/udisks2/gvfsudisks2volumemonitor.c | 33 |
1 files changed, 1 insertions, 32 deletions
diff --git a/monitor/udisks2/gvfsudisks2volumemonitor.c b/monitor/udisks2/gvfsudisks2volumemonitor.c index b200457d..4ecabd99 100644 --- a/monitor/udisks2/gvfsudisks2volumemonitor.c +++ b/monitor/udisks2/gvfsudisks2volumemonitor.c @@ -606,37 +606,6 @@ update_all (GVfsUDisks2VolumeMonitor *monitor, /* ---------------------------------------------------------------------------------------------------- */ -static GUnixMountPoint * -get_mount_point_for_mount (GUnixMountEntry *mount_entry) -{ - GUnixMountPoint *ret = NULL; - GList *mount_points, *l; - - mount_points = g_unix_mount_points_get (NULL); - for (l = mount_points; l != NULL; l = l->next) - { - GUnixMountPoint *mount_point = l->data; - if (g_strcmp0 (g_unix_mount_get_mount_path (mount_entry), - g_unix_mount_point_get_mount_path (mount_point)) == 0) - { - ret = mount_point; - goto out; - } - } - - out: - for (l = mount_points; l != NULL; l = l->next) - { - GUnixMountPoint *mount_point = l->data; - if (G_LIKELY (mount_point != ret)) - g_unix_mount_point_free (mount_point); - } - g_list_free (mount_points); - return ret; -} - -/* ---------------------------------------------------------------------------------------------------- */ - static gboolean should_include (const gchar *mount_path, const gchar *options) @@ -739,7 +708,7 @@ should_include_mount (GVfsUDisks2VolumeMonitor *monitor, * in prior to g_unix_mount_get_options to keep support of "comment=" options, * see https://gitlab.gnome.org/GNOME/gvfs/issues/348. */ - mount_point = get_mount_point_for_mount (mount_entry); + mount_point = g_unix_mount_point_at (g_unix_mount_get_mount_path (mount_entry), NULL); if (mount_point != NULL) { ret = should_include_mount_point (monitor, mount_point); |