summaryrefslogtreecommitdiff
path: root/gdbus
diff options
context:
space:
mode:
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;
}