]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
bus-util: Fix bus_log_connect_error() 34851/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 22 Oct 2024 10:32:02 +0000 (12:32 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Tue, 22 Oct 2024 10:32:02 +0000 (12:32 +0200)
src/shared/bus-util.c

index fa4f879b7bac3d304856fbbc3424fabc9361010f..ce94597955aa3bfdfe88239fe34ed59763269bfe 100644 (file)
@@ -56,9 +56,9 @@ int bus_log_connect_error(int r, BusTransport transport, RuntimeScope scope) {
              hint_addr = transport == BUS_TRANSPORT_LOCAL && ERRNO_IS_PRIVILEGE(r);
 
         return log_error_errno(r,
-                               r == hint_vars ? "Failed to connect to %s scope bus via %s transport: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined (consider using --machine=<user>@.host --user to connect to bus of other user)" :
-                               r == hint_addr ? "Failed to connect to %s scope bus via %s transport: Operation not permitted (consider using --machine=<user>@.host --user to connect to bus of other user)" :
-                                                "Failed to connect to %s scope bus via %s transport: %m", runtime_scope_to_string(scope), bus_transport_to_string(transport));
+                               hint_vars ? "Failed to connect to %s scope bus via %s transport: $DBUS_SESSION_BUS_ADDRESS and $XDG_RUNTIME_DIR not defined (consider using --machine=<user>@.host --user to connect to bus of other user)" :
+                               hint_addr ? "Failed to connect to %s scope bus via %s transport: Operation not permitted (consider using --machine=<user>@.host --user to connect to bus of other user)" :
+                                           "Failed to connect to %s scope bus via %s transport: %m", runtime_scope_to_string(scope), bus_transport_to_string(transport));
 }
 
 int bus_async_unregister_and_exit(sd_event *e, sd_bus *bus, const char *name) {