console-dbus: Connect to the default bus
sd_bus_default() connects to the system bus unless it detects a user
slice, in which case it connects to the bus for the user session.
This should keep the desired behavior in-context e.g. on a BMC, while
making it slightly more ergonomic to run obmc-console-server under
dbus-run-session(1) for testing.
Change-Id: I0b5acfae49dcab9ec4f72159ba51296e118017ae
Signed-off-by: Andrew Jeffery <andrew@codeconstruct.com.au>
diff --git a/console-dbus.c b/console-dbus.c
index 91d99c7..7968721 100644
--- a/console-dbus.c
+++ b/console-dbus.c
@@ -174,9 +174,9 @@
return;
}
- r = sd_bus_default_system(&console->bus);
+ r = sd_bus_default(&console->bus);
if (r < 0) {
- warnx("Failed to connect to system bus: %s", strerror(-r));
+ warnx("Failed to connect to bus: %s", strerror(-r));
return;
}