From: Sven Eden Date: Wed, 14 Jun 2017 15:44:53 +0000 (+0200) Subject: Prep v231: Apply missing fixes from upstream (5/6) src/shared X-Git-Tag: v231.3~53 X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=commitdiff_plain;h=d0da92ba28e1abe4e6314ef3f0876871aa238f33 Prep v231: Apply missing fixes from upstream (5/6) src/shared --- diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c index ebfe2255f..5ea4e5608 100644 --- a/src/shared/bus-util.c +++ b/src/shared/bus-util.c @@ -1519,40 +1519,6 @@ int bus_path_decode_unique(const char *path, const char *prefix, char **ret_send } #endif // 0 -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) { - _cleanup_close_ int fd = -1; - struct kdbus_cmd cmd = { .size = sizeof(cmd), .flags = KDBUS_FLAG_NEGOTIATE }; - - if (!is_kdbus_wanted()) - return false; - - fd = open("/sys/fs/kdbus/control", O_RDWR | O_CLOEXEC | O_NONBLOCK | O_NOCTTY); - if (fd < 0) - return false; - - return ioctl(fd, KDBUS_CMD_BUS_MAKE, &cmd) >= 0; -} - #if 0 /// UNNEEDED by elogind int bus_property_get_rlimit( sd_bus *bus, diff --git a/src/shared/bus-util.h b/src/shared/bus-util.h index df446edc1..88c2804d6 100644 --- a/src/shared/bus-util.h +++ b/src/shared/bus-util.h @@ -173,9 +173,6 @@ int bus_path_encode_unique(sd_bus *b, const char *prefix, const char *sender_id, int bus_path_decode_unique(const char *path, const char *prefix, char **ret_sender, char **ret_external); #endif // 0 -bool is_kdbus_wanted(void); -bool is_kdbus_available(void); - #if 0 /// UNNEEDED by elogind int bus_property_get_rlimit(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *error); #endif // 0