summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Larsson <alexl@redhat.com>2012-08-23 22:00:02 +0200
committerAlexander Larsson <alexl@redhat.com>2012-08-23 22:00:48 +0200
commitc3309dfdf5c3d60c6666a8a8883990ccdab383ae (patch)
treecfd25466338533b6852b01f3a2f46f3b1e06786f
parentd54643d8e74dc80777f7cb279bd9c3e20b7d05b2 (diff)
downloadgvfs-c3309dfdf5c3d60c6666a8a8883990ccdab383ae.tar.gz
Report back error_code on spawn fail due to bus name already owned
We return the not-quite-right ALREADY_MOUNTED. Its not strictly right because just because the name is owned does not mean the mount has been registred yet.
-rw-r--r--common/org.gtk.vfs.xml1
-rw-r--r--daemon/daemon-main.c11
2 files changed, 7 insertions, 5 deletions
diff --git a/common/org.gtk.vfs.xml b/common/org.gtk.vfs.xml
index e13347cf..fc68d592 100644
--- a/common/org.gtk.vfs.xml
+++ b/common/org.gtk.vfs.xml
@@ -55,6 +55,7 @@
<method name="Spawned">
<arg type='b' name='succeeded' direction='in'/>
<arg type='s' name='error_message' direction='in'/>
+ <arg type='u' name='error_code' direction='in'/>
</method>
</interface>
diff --git a/daemon/daemon-main.c b/daemon/daemon-main.c
index 4aa8556e..c52253d2 100644
--- a/daemon/daemon-main.c
+++ b/daemon/daemon-main.c
@@ -159,6 +159,7 @@ call_spawned_cb (GVfsDBusSpawner *proxy,
static void
send_spawned (gboolean succeeded,
char *error_message,
+ guint32 error_code,
GDestroyNotify callback,
gpointer user_data)
{
@@ -202,6 +203,7 @@ send_spawned (gboolean succeeded,
gvfs_dbus_spawner_call_spawned (proxy,
succeeded,
error_message,
+ error_code,
NULL,
(GAsyncReadyCallback) call_spawned_cb,
data);
@@ -303,10 +305,9 @@ on_name_lost (GDBusConnection *connection,
else
{
s = g_strdup_printf (_("mountpoint for %s already running"), data->mountable_name);
- g_printerr (_("Error: %s"), s);
- g_printerr ("\n");
+ send_spawned (FALSE, s, G_IO_ERROR_ALREADY_MOUNTED, spawned_failed_cb, data);
g_free (s);
- process_result = 1;
+ return;
}
}
g_main_loop_quit (loop);
@@ -324,13 +325,13 @@ on_name_acquired (GDBusConnection *connection,
data->daemon = g_vfs_daemon_new (FALSE, FALSE);
if (data->daemon == NULL)
{
- send_spawned (FALSE, _("error starting mount daemon"), spawned_failed_cb, data);
+ send_spawned (FALSE, _("error starting mount daemon"), G_IO_ERROR_FAILED, spawned_failed_cb, data);
return;
}
g_vfs_daemon_set_max_threads (data->daemon, data->max_job_threads);
- send_spawned (TRUE, NULL, spawned_succeeded_cb, data);
+ send_spawned (TRUE, NULL, 0, spawned_succeeded_cb, data);
}
static gboolean