summaryrefslogtreecommitdiff
path: root/gdbus
diff options
context:
space:
mode:
authorVinicius Costa Gomes <vinicius.gomes@openbossa.org>2010-02-01 16:16:22 -0300
committerMarcel Holtmann <marcel@holtmann.org>2010-03-07 14:31:24 -0800
commita40f41a4374f0af01a83f209c46cd64ce62c9e43 (patch)
treefa8a2c1e7654acdfc4439820f1d4712a171f71de /gdbus
parentff6c7c257c620aea8a4c3c9c2a99551972166407 (diff)
downloadconnman-a40f41a4374f0af01a83f209c46cd64ce62c9e43.tar.gz
connman-a40f41a4374f0af01a83f209c46cd64ce62c9e43.tar.bz2
connman-a40f41a4374f0af01a83f209c46cd64ce62c9e43.zip
Fix the case when the requested name is already in use
We weren't setting the dbus error in this situation.
Diffstat (limited to 'gdbus')
-rw-r--r--gdbus/mainloop.c6
1 files changed, 5 insertions, 1 deletions
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;
}