From a181ec319bf888e6657e1ea1354c3161f9441df7 Mon Sep 17 00:00:00 2001 From: Vinicius Costa Gomes Date: Mon, 1 Feb 2010 16:16:22 -0300 Subject: [PATCH] Fix the case when the requested name is already in use We weren't setting the dbus error in this situation. --- gdbus/mainloop.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/gdbus/mainloop.c b/gdbus/mainloop.c index 7f2d001e..ec10ab06 100644 --- a/gdbus/mainloop.c +++ b/gdbus/mainloop.c @@ -347,8 +347,12 @@ gboolean g_dbus_request_name(DBusConnection *connection, const char *name, return FALSE; } - if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) + if (result != DBUS_REQUEST_NAME_REPLY_PRIMARY_OWNER) { + if (error != NULL) + dbus_set_error(error, name, "Name already in use"); + return FALSE; + } return TRUE; }