Browse Source

dbus: fix bus type reported in logs

lines
Stefano Ragni 1 year ago
committed by Wim Taymans
parent
commit
243d534476
2 changed files with 11 additions and 2 deletions
  1. +10
    -1
      spa/plugins/support/dbus.c
  2. +1
    -1
      src/modules/module-portal.c

+ 10
- 1
spa/plugins/support/dbus.c View File

@ -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;


+ 1
- 1
src/modules/module-portal.c View File

@ -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…
Cancel
Save