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:
+2
-2
@@ -129,11 +129,11 @@ static int acquire_bus(bool set_monitor, sd_bus **ret) {
|
||||
}
|
||||
}
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to set address: %m");
|
||||
return bus_log_address_error(r);
|
||||
|
||||
r = sd_bus_start(bus);
|
||||
if (r < 0)
|
||||
return log_error_errno(r, "Failed to connect to bus: %m");
|
||||
return bus_log_connect_error(r);
|
||||
|
||||
*ret = TAKE_PTR(bus);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user