summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2007-10-30 16:20:52 +0000
committerAlexander Larsson <alexl@src.gnome.org>2007-10-30 16:20:52 +0000
commit815843833a89d3633cef86f2c0effcfbb3b740fb (patch)
treec14854eb9f96d8545a138a0c377afe6d69727902
parentcdf172a6638a0fe4c5de48e47131386e287d9fea (diff)
downloadgvfs-815843833a89d3633cef86f2c0effcfbb3b740fb.tar.gz
Handle threads not being initialized
2007-10-30 Alexander Larsson <alexl@redhat.com> * common/gmounttracker.c: Handle threads not being initialized * daemon/gvfsjobqueryfsinfo.c: Set volume name svn path=/trunk/; revision=998
-rw-r--r--ChangeLog8
-rw-r--r--common/gmounttracker.c21
-rw-r--r--daemon/gvfsjobqueryfsinfo.c8
3 files changed, 29 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index 799a7cd3..b574f409 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2007-10-30 Alexander Larsson <alexl@redhat.com>
+
+ * common/gmounttracker.c:
+ Handle threads not being initialized
+
+ * daemon/gvfsjobqueryfsinfo.c:
+ Set volume name
+
2007-10-26 Alexander Larsson <alexl@redhat.com>
* client/gdaemonvolumemonitor.c:
diff --git a/common/gmounttracker.c b/common/gmounttracker.c
index d1016cf0..87252dab 100644
--- a/common/gmounttracker.c
+++ b/common/gmounttracker.c
@@ -422,7 +422,8 @@ init_connection (GMountTracker *tracker)
static void
g_mount_tracker_init (GMountTracker *tracker)
{
- tracker->lock = g_mutex_new ();
+ if (g_thread_supported ())
+ tracker->lock = g_mutex_new ();
}
@@ -461,7 +462,8 @@ g_mount_tracker_list_mounts (GMountTracker *tracker)
GList *res, *l;
GMountInfo *copy;
- g_mutex_lock (tracker->lock);
+ if (tracker->lock)
+ g_mutex_lock (tracker->lock);
res = NULL;
for (l = tracker->mounts; l != NULL; l = l->next)
@@ -470,7 +472,8 @@ g_mount_tracker_list_mounts (GMountTracker *tracker)
res = g_list_prepend (res, copy);
}
- g_mutex_unlock (tracker->lock);
+ if (tracker->lock)
+ g_mutex_unlock (tracker->lock);
return g_list_reverse (res);
}
@@ -482,7 +485,8 @@ g_mount_tracker_find_by_mount_spec (GMountTracker *tracker,
GList *l;
GMountInfo *info, *found;
- g_mutex_lock (tracker->lock);
+ if (tracker->lock)
+ g_mutex_lock (tracker->lock);
found = NULL;
for (l = tracker->mounts; l != NULL; l = l->next)
@@ -496,7 +500,8 @@ g_mount_tracker_find_by_mount_spec (GMountTracker *tracker,
}
}
- g_mutex_unlock (tracker->lock);
+ if (tracker->lock)
+ g_mutex_unlock (tracker->lock);
return found;
}
@@ -510,7 +515,8 @@ g_mount_tracker_has_mount_spec (GMountTracker *tracker,
GMountInfo *info;
gboolean found;
- g_mutex_lock (tracker->lock);
+ if (tracker->lock)
+ g_mutex_lock (tracker->lock);
found = FALSE;
for (l = tracker->mounts; l != NULL; l = l->next)
@@ -524,7 +530,8 @@ g_mount_tracker_has_mount_spec (GMountTracker *tracker,
}
}
- g_mutex_unlock (tracker->lock);
+ if (tracker->lock)
+ g_mutex_unlock (tracker->lock);
return found;
}
diff --git a/daemon/gvfsjobqueryfsinfo.c b/daemon/gvfsjobqueryfsinfo.c
index dc7a4f36..6bf74597 100644
--- a/daemon/gvfsjobqueryfsinfo.c
+++ b/daemon/gvfsjobqueryfsinfo.c
@@ -142,7 +142,7 @@ create_reply (GVfsJob *job,
GVfsJobQueryFsInfo *op_job = G_VFS_JOB_QUERY_FS_INFO (job);
DBusMessage *reply;
DBusMessageIter iter;
- const char *type;
+ const char *type, *name;
reply = dbus_message_new_method_return (message);
@@ -154,6 +154,12 @@ create_reply (GVfsJob *job,
g_file_info_set_attribute_string (op_job->file_info,
G_FILE_ATTRIBUTE_GVFS_BACKEND,
type);
+
+ name = g_vfs_backend_get_display_name (op_job->backend);
+ if (name)
+ g_file_info_set_attribute_string (op_job->file_info,
+ G_FILE_ATTRIBUTE_FS_VOLUME_NAME,
+ name);
_g_dbus_append_file_info (&iter,
op_job->file_info);