X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Fbus-util.c;h=5ea4e56087d3fd01b6310652a80dff2379db21d8;hb=c44dff35969ac35ad0ff9028658614d94a54ae22;hp=12b091cebe446ca1e1b31f82c07bcbc26685db90;hpb=2a66b8a6446a876696fe59cbb0c4dcdee8cf41a7;p=elogind.git diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c index 12b091ceb..5ea4e5608 100644 --- a/src/shared/bus-util.c +++ b/src/shared/bus-util.c @@ -1052,7 +1052,7 @@ static int map_basic(sd_bus *bus, const char *member, sd_bus_message *m, sd_bus_ case SD_BUS_TYPE_BOOLEAN: { unsigned b; - bool *p = userdata; + int *p = userdata; r = sd_bus_message_read_basic(m, type, &b); if (r < 0) @@ -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,