summaryrefslogtreecommitdiff
path: root/src/bus-proxyd/bus-proxyd.c
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2015-08-11 20:46:05 +0200
committerKay Sievers <kay@vrfy.org>2015-08-11 20:49:36 +0200
commitd4d00020d6ad855d65d31020fefa5003e1bb477f (patch)
tree312c253adaf27c87c111d20a116df40a6496e468 /src/bus-proxyd/bus-proxyd.c
parent3f1818cf70ac34cf93f1f033b4f1bbb7a89b3dff (diff)
sd-bus: do not connect to dbus-1 socket when kdbus is available
We should not fall back to dbus-1 and connect to the proxy when kdbus returns an error that indicates that kdbus is running but just does not accept new connections because of quota limits or something similar. Using is_kdbus_available() in libsystemd/ requires it to move from shared/ to libsystemd/. Based on a patch from David Herrmann: https://github.com/systemd/systemd/pull/886
Diffstat (limited to 'src/bus-proxyd/bus-proxyd.c')
-rw-r--r--src/bus-proxyd/bus-proxyd.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/bus-proxyd/bus-proxyd.c b/src/bus-proxyd/bus-proxyd.c
index 3cc3b33ae7..6e07aea94e 100644
--- a/src/bus-proxyd/bus-proxyd.c
+++ b/src/bus-proxyd/bus-proxyd.c
@@ -177,8 +177,9 @@ static int help(void) {
" --configuration=PATH Configuration file or directory\n"
" --machine=MACHINE Connect to specified machine\n"
" --address=ADDRESS Connect to the bus specified by ADDRESS\n"
- " (default: " DEFAULT_SYSTEM_BUS_ADDRESS ")\n",
- program_invocation_short_name);
+ " (default: %s)\n",
+ program_invocation_short_name,
+ is_kdbus_available() ? KERNEL_SYSTEM_BUS_ADDRESS : UNIX_SYSTEM_BUS_ADDRESS);
return 0;
}
@@ -262,7 +263,7 @@ static int parse_argv(int argc, char *argv[]) {
}
if (!arg_address) {
- arg_address = strdup(DEFAULT_SYSTEM_BUS_ADDRESS);
+ arg_address = strdup(is_kdbus_available() ? KERNEL_SYSTEM_BUS_ADDRESS : UNIX_SYSTEM_BUS_ADDRESS);
if (!arg_address)
return log_oom();
}