rtkit: improve error message

This commit is contained in:
Wim Taymans 2020-11-04 09:42:33 +01:00
parent 12cefd2461
commit 4ea95abd90

View file

@ -128,8 +128,10 @@ struct pw_rtkit_bus *pw_rtkit_bus_get_system(void)
struct pw_rtkit_bus *bus; struct pw_rtkit_bus *bus;
DBusError error; DBusError error;
if (getenv("DISABLE_RTKIT")) if (getenv("DISABLE_RTKIT")) {
errno = ENOTSUP;
return NULL; return NULL;
}
dbus_error_init(&error); dbus_error_init(&error);
@ -149,6 +151,7 @@ error:
free(bus); free(bus);
pw_log_error("Failed to connect to system bus: %s", error.message); pw_log_error("Failed to connect to system bus: %s", error.message);
dbus_error_free(&error); dbus_error_free(&error);
errno = ECONNREFUSED;
return NULL; return NULL;
} }