sd-bus: add custom return code when $XDG_RUNTIME_DIR is not set

We would return ENOENT, which is extremely confusing. Strace is not helpful because
no *file* is actually missing. So let's add some logs at debug level and also use
a custom return code. Let all user-facing utilities print a custom error message
in that case.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2020-10-14 18:28:30 +02:00
parent 165fee860a
commit ab4a88eb92
10 changed files with 28 additions and 14 deletions
+1 -1
View File
@@ -52,7 +52,7 @@ int acquire_bus(BusFocus focus, sd_bus **ret) {
else
r = bus_connect_transport(arg_transport, arg_host, user, &buses[focus]);
if (r < 0)
return log_error_errno(r, "Failed to connect to bus: %m");
return bus_log_connect_error(r);
(void) sd_bus_set_allow_interactive_authorization(buses[focus], arg_ask_password);
}