summaryrefslogtreecommitdiff
path: root/src/shared/bus-util.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-11-04 10:41:47 +0100
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2021-11-04 11:00:15 +0100
commitfb293b3c0f2f0e24d088a6ccaf3bd051301754af (patch)
tree32fcaff481a8cfa5d2351648edd58c1ab42cc249 /src/shared/bus-util.c
parent237fbb67194bee720d95cb0ab20821e1822e8ce4 (diff)
downloadsystemd-fb293b3c0f2f0e24d088a6ccaf3bd051301754af.tar.gz
busctl: do not print hint about -M if -M is already used
(Or when -H is used, since -H and -M are incompatible.)
Diffstat (limited to 'src/shared/bus-util.c')
-rw-r--r--src/shared/bus-util.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c
index 75e89ab5dc..8568135a4a 100644
--- a/src/shared/bus-util.c
+++ b/src/shared/bus-util.c
@@ -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) {