summaryrefslogtreecommitdiff
path: root/src/libsystemd/sd-bus/bus-internal.c
diff options
context:
space:
mode:
authorDavid Herrmann <dh.herrmann@gmail.com>2015-08-27 16:32:22 +0200
committerDavid Herrmann <dh.herrmann@gmail.com>2015-08-27 16:32:22 +0200
commit057171efc103ac76c60a2a0d277d8bbf25415c21 (patch)
tree1f86acb043d5bf79725d89240c377fe2ed679066 /src/libsystemd/sd-bus/bus-internal.c
parent8faae625dc9b6322db452937f54176e56e65265a (diff)
Revert "sd-bus: do not connect to dbus-1 socket when kdbus is available"
This reverts commit d4d00020d6ad855d65d31020fefa5003e1bb477f. The idea of the commit is broken and needs to be reworked. We really cannot reduce the bus-addresses to a single address. We always will have systemd with native clients and legacy clients at the same time, so we also need both addresses at the same time.
Diffstat (limited to 'src/libsystemd/sd-bus/bus-internal.c')
-rw-r--r--src/libsystemd/sd-bus/bus-internal.c42
1 files changed, 0 insertions, 42 deletions
diff --git a/src/libsystemd/sd-bus/bus-internal.c b/src/libsystemd/sd-bus/bus-internal.c
index f4ab57f5bc..fea796cd30 100644
--- a/src/libsystemd/sd-bus/bus-internal.c
+++ b/src/libsystemd/sd-bus/bus-internal.c
@@ -371,45 +371,3 @@ int bus_maybe_reply_error(sd_bus_message *m, int r, sd_bus_error *error) {
return 1;
}
-
-bool is_kdbus_wanted(void) {
- _cleanup_free_ char *value = NULL;
-#ifdef ENABLE_KDBUS
- const bool configured = true;
-#else
- const bool configured = false;
-#endif
- int r;
-
- if (get_proc_cmdline_key("kdbus", NULL) > 0)
- return true;
-
- r = get_proc_cmdline_key("kdbus=", &value);
- if (r <= 0)
- return configured;
-
- return parse_boolean(value) == 1;
-}
-
-bool is_kdbus_available(void) {
- static int cached = -1;
- _cleanup_close_ int fd = -1;
- struct kdbus_cmd cmd = { .size = sizeof(cmd), .flags = KDBUS_FLAG_NEGOTIATE };
-
- if (cached >= 0)
- return (bool) cached;
-
- if (!is_kdbus_wanted()) {
- cached = false;
- return false;
- }
-
- fd = open("/sys/fs/kdbus/control", O_RDWR | O_CLOEXEC | O_NONBLOCK | O_NOCTTY);
- if (fd < 0) {
- cached = false;
- return false;
- }
-
- cached = ioctl(fd, KDBUS_CMD_BUS_MAKE, &cmd) >= 0;
- return cached;
-}