libmapper: allow use of session bus for non-root
sd_bus_default will automatically pick the system bus when run as root
as intended. By using sd_bus_default instead of sd_bus_default_system
we can connect to a mapper daemon running on the session bus.
https://www.freedesktop.org/software/systemd/man/sd_bus_open_user.html
Change-Id: I7accd6119bfd84351f9a99af7cdd0dc6bf29a83c
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
diff --git a/libmapper/app.c b/libmapper/app.c
index 45173bb..84be79d 100644
--- a/libmapper/app.c
+++ b/libmapper/app.c
@@ -53,7 +53,7 @@
{
attempts++;
- r = sd_bus_default_system(&conn);
+ r = sd_bus_default(&conn);
if (r < 0)
{
fprintf(stderr, "Error connecting to system bus: %s\n",
@@ -150,7 +150,7 @@
exit(EXIT_FAILURE);
}
- r = sd_bus_default_system(&conn);
+ r = sd_bus_default(&conn);
if (r < 0)
{
fprintf(stderr, "Error connecting to system bus: %s\n", strerror(-r));
@@ -215,7 +215,7 @@
exit(EXIT_FAILURE);
}
- r = sd_bus_default_system(&conn);
+ r = sd_bus_default(&conn);
if (r < 0)
{
fprintf(stderr, "Error connecting to system bus: %s\n", strerror(-r));