summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2008-03-04 13:40:28 +0000
committerAlexander Larsson <alexl@src.gnome.org>2008-03-04 13:40:28 +0000
commitdaa32f1ec94fc1cc66912c3640bc388c0a64edfe (patch)
tree529027840b959899c75e48d6887b5460261ddbe5
parent1d88256e3b72222d3cae379c529a97b71ee00049 (diff)
downloadgvfs-daa32f1ec94fc1cc66912c3640bc388c0a64edfe.tar.gz
Fix deadlock when looking for cdrom icons.
2008-03-04 Alexander Larsson <alexl@redhat.com> * hal/ghalmount.c: Fix deadlock when looking for cdrom icons. svn path=/trunk/; revision=1526
-rw-r--r--ChangeLog5
-rw-r--r--hal/ghalmount.c21
2 files changed, 19 insertions, 7 deletions
diff --git a/ChangeLog b/ChangeLog
index 27e24b64..4c9ad558 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2008-03-04 Alexander Larsson <alexl@redhat.com>
+
+ * hal/ghalmount.c:
+ Fix deadlock when looking for cdrom icons.
+
2008-03-04 Benjamin Otte <otte@gnome.org>
* daemon/gvfsbackendftp.c: (run_list_command):
diff --git a/hal/ghalmount.c b/hal/ghalmount.c
index 06a32172..e270f510 100644
--- a/hal/ghalmount.c
+++ b/hal/ghalmount.c
@@ -74,6 +74,9 @@ _g_find_file_insensitive_async (GFile *parent,
GAsyncReadyCallback callback,
gpointer user_data);
+
+static GFile *get_root (GHalMount *hal_mount);
+
static void g_hal_mount_mount_iface_init (GMountIface *iface);
#define _G_IMPLEMENT_INTERFACE_DYNAMIC(TYPE_IFACE, iface_init) { \
@@ -341,7 +344,7 @@ _g_find_mount_icon (GHalMount *m)
search_data = g_new0 (MountIconSearchData, 1);
search_data->mount = g_object_ref (m);
- search_data->root = g_mount_get_root (G_MOUNT (m));
+ search_data->root = get_root (m);
_g_find_file_insensitive_async (search_data->root,
"autorun.inf",
@@ -775,18 +778,22 @@ g_hal_mount_unset_volume (GHalMount *mount,
}
static GFile *
+get_root (GHalMount *hal_mount)
+{
+ if (hal_mount->override_root != NULL)
+ return g_object_ref (hal_mount->override_root);
+ else
+ return g_file_new_for_path (hal_mount->mount_path);
+}
+
+static GFile *
g_hal_mount_get_root (GMount *mount)
{
GHalMount *hal_mount = G_HAL_MOUNT (mount);
GFile *root;
G_LOCK (hal_mount);
-
- if (hal_mount->override_root != NULL)
- root = g_object_ref (hal_mount->override_root);
- else
- root = g_file_new_for_path (hal_mount->mount_path);
-
+ root = get_root (hal_mount);
G_UNLOCK (hal_mount);
return root;