From a2c2c52928cd85fabcb7bf41476400ec4bb43611 Mon Sep 17 00:00:00 2001 From: Tomas Bzatek Date: Wed, 18 Apr 2012 16:58:48 +0200 Subject: gdbus: Silence unmount failures ...and fix wrong typecast due to using an object we haven't reff'ed. The failure we're making silent were coming from a failed d-bus call to mount tracker. Also turned out the org.gtk.vfs.MountTracker.unregisterMount() has never been implemented, daemon mounttracker is watching for clients disconnects anyway. --- daemon/gvfsjobunmount.c | 16 ++++++---------- daemon/mount.c | 1 + 2 files changed, 7 insertions(+), 10 deletions(-) (limited to 'daemon') diff --git a/daemon/gvfsjobunmount.c b/daemon/gvfsjobunmount.c index 7e79d691..ed78f5a1 100644 --- a/daemon/gvfsjobunmount.c +++ b/daemon/gvfsjobunmount.c @@ -277,20 +277,16 @@ unregister_mount_callback (GVfsDBusMountTracker *proxy, { GVfsBackend *backend; GVfsDaemon *daemon; - GVfsJob *job = G_VFS_JOB (user_data); GVfsJobUnmount *op_job = G_VFS_JOB_UNMOUNT (user_data); GError *error = NULL; - gvfs_dbus_mount_tracker_call_unregister_mount_finish (proxy, - res, - &error); - g_debug ("unregister_mount_callback, error: %p\n", error); - - if (error != NULL) + g_debug ("unregister_mount_callback\n"); + if (! gvfs_dbus_mount_tracker_call_unregister_mount_finish (proxy, + res, + &error)) { - /* If we failed before, don't overwrite the error as this one is not that important */ - if (! job->failed) - g_vfs_job_failed_from_error (job, error); + g_warning ("Error unregistering mount: %s (%s, %d)\n", + error->message, g_quark_to_string (error->domain), error->code); g_error_free (error); } diff --git a/daemon/mount.c b/daemon/mount.c index 47a41912..9649f0cf 100644 --- a/daemon/mount.c +++ b/daemon/mount.c @@ -1068,6 +1068,7 @@ mount_init (void) g_signal_connect (mount_tracker, "handle-list-mounts", G_CALLBACK (handle_list_mounts), NULL); g_signal_connect (mount_tracker, "handle-list-mountable-info", G_CALLBACK (handle_list_mountable_info), NULL); g_signal_connect (mount_tracker, "handle-list-mount-types", G_CALLBACK (handle_list_mount_types), NULL); + /* FIXME: handle unregisterMount() */ error = NULL; if (!g_dbus_interface_skeleton_export (G_DBUS_INTERFACE_SKELETON (mount_tracker), conn, -- cgit v1.2.1