Fix the case when the requested name is already in use

We weren't setting the dbus error in this situation.
This commit is contained in:
Vinicius Costa Gomes 2010-02-01 16:16:22 -03:00 committed by Marcel Holtmann
parent ee620aca94
commit e6b83be22e

View File

@ -347,8 +347,12 @@ gboolean g_dbus_request_name(DBusConnection *connection, const char *name,
return FALSE; 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 FALSE;
}
return TRUE; return TRUE;
} }