mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-10-29 05:40:27 -04:00
dbus: fix bus type reported in logs
This commit is contained in:
parent
c69ebf6361
commit
243d534476
2 changed files with 11 additions and 2 deletions
|
|
@ -296,6 +296,15 @@ static DBusHandlerResult filter_message (DBusConnection *connection,
|
|||
return DBUS_HANDLER_RESULT_NOT_YET_HANDLED;
|
||||
}
|
||||
|
||||
static const char *type_to_string(enum spa_dbus_type type) {
|
||||
switch (type) {
|
||||
case SPA_DBUS_TYPE_SESSION: return "session";
|
||||
case SPA_DBUS_TYPE_SYSTEM: return "system";
|
||||
case SPA_DBUS_TYPE_STARTER: return "starter";
|
||||
default: return "unknown";
|
||||
}
|
||||
}
|
||||
|
||||
static void *
|
||||
impl_connection_get(struct spa_dbus_connection *conn)
|
||||
{
|
||||
|
|
@ -326,7 +335,7 @@ impl_connection_get(struct spa_dbus_connection *conn)
|
|||
return this->conn;
|
||||
|
||||
error:
|
||||
spa_log_error(impl->log, "Failed to connect to system bus: %s", error.message);
|
||||
spa_log_error(impl->log, "Failed to connect to %s bus: %s", type_to_string(this->type), error.message);
|
||||
dbus_error_free(&error);
|
||||
errno = ECONNREFUSED;
|
||||
return NULL;
|
||||
|
|
|
|||
|
|
@ -301,6 +301,6 @@ int pipewire__module_init(struct pw_impl_module *module, const char *args)
|
|||
|
||||
error:
|
||||
free(impl);
|
||||
pw_log_error("Failed to connect to system bus: %s", spa_strerror(res));
|
||||
pw_log_error("Failed to connect to session bus: %s", spa_strerror(res));
|
||||
return res;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue