mirror of
https://github.com/Dasharo/systemd.git
synced 2026-03-06 15:02:31 -08:00
busctl: do not print hint about -M if -M is already used
(Or when -H is used, since -H and -M are incompatible.)
This commit is contained in:
@@ -125,7 +125,7 @@ static int acquire_bus(bool set_monitor, sd_bus **ret) {
|
||||
}
|
||||
}
|
||||
if (r < 0)
|
||||
return bus_log_address_error(r);
|
||||
return bus_log_address_error(r, arg_transport);
|
||||
|
||||
r = sd_bus_start(bus);
|
||||
if (r < 0)
|
||||
|
||||
@@ -34,10 +34,12 @@ static int name_owner_change_callback(sd_bus_message *m, void *userdata, sd_bus_
|
||||
return 1;
|
||||
}
|
||||
|
||||
int bus_log_address_error(int r) {
|
||||
int bus_log_address_error(int r, BusTransport transport) {
|
||||
bool hint = transport == BUS_TRANSPORT_LOCAL && r == -ENOMEDIUM;
|
||||
|
||||
return log_error_errno(r,
|
||||
r == -ENOMEDIUM ? "Failed to set bus address: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined (consider using --machine=<user>@.host --user to connect to bus of other user)" :
|
||||
"Failed to set bus address: %m");
|
||||
hint ? "Failed to set bus address: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined (consider using --machine=<user>@.host --user to connect to bus of other user)" :
|
||||
"Failed to set bus address: %m");
|
||||
}
|
||||
|
||||
int bus_log_connect_error(int r) {
|
||||
|
||||
@@ -39,7 +39,7 @@ int bus_connect_user_systemd(sd_bus **_bus);
|
||||
int bus_connect_transport(BusTransport transport, const char *host, bool user, sd_bus **bus);
|
||||
int bus_connect_transport_systemd(BusTransport transport, const char *host, bool user, sd_bus **bus);
|
||||
|
||||
int bus_log_address_error(int r);
|
||||
int bus_log_address_error(int r, BusTransport transport);
|
||||
int bus_log_connect_error(int r);
|
||||
|
||||
#define bus_log_parse_error(r) \
|
||||
|
||||
Reference in New Issue
Block a user