[gvfs/wip/oholy/x-gvfs-notrash: 9/9] udisks2: Replace custom code by g_unix_mount_point_at
- From: Ondrej Holy <oholy src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gvfs/wip/oholy/x-gvfs-notrash: 9/9] udisks2: Replace custom code by g_unix_mount_point_at
- Date: Wed, 5 Aug 2020 13:57:22 +0000 (UTC)
commit 077abad24355846fb8d77c2f3be2673010629f74
Author: Ondrej Holy <oholy redhat com>
Date: Tue Jun 23 08:33:11 2020 +0200
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.
monitor/udisks2/gvfsudisks2volumemonitor.c | 33 +-----------------------------
1 file changed, 1 insertion(+), 32 deletions(-)
---
diff --git a/monitor/udisks2/gvfsudisks2volumemonitor.c b/monitor/udisks2/gvfsudisks2volumemonitor.c
index b200457d6..4ecabd99a 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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]