chiark / gitweb /
Rename formats-util.h to format-util.h
[elogind.git] / src / libelogind / sd-bus / bus-kernel.c
index 7886e3a38a95232a5db259c0d8734b251ff59956..aef1511271f4a0fae0ca29803ad3f8eba5a52c20 100644 (file)
@@ -42,7 +42,7 @@
 #include "capability-util.h"
 #include "fd-util.h"
 #include "fileio.h"
-#include "formats-util.h"
+#include "format-util.h"
 #include "memfd-util.h"
 #include "parse-util.h"
 #include "stdio-util.h"
@@ -1650,7 +1650,7 @@ int bus_kernel_create_bus(const char *name, bool world, char **s) {
         if (s) {
                 char *p;
 
-                p = strjoin("/sys/fs/kdbus/", n->str, "/bus", NULL);
+                p = strjoin("/sys/fs/kdbus/", n->str, "/bus");
                 if (!p) {
                         safe_close(fd);
                         return -ENOMEM;
@@ -1695,52 +1695,6 @@ int bus_kernel_open_bus_fd(const char *bus, char **path) {
         return fd;
 }
 
-#if 0 /// UNNEEDED by elogind
-int bus_kernel_create_endpoint(const char *bus_name, const char *ep_name, char **ep_path) {
-        _cleanup_free_ char *path = NULL;
-        struct kdbus_cmd *make;
-        struct kdbus_item *n;
-        const char *name;
-        int fd;
-
-        fd = bus_kernel_open_bus_fd(bus_name, &path);
-        if (fd < 0)
-                return fd;
-
-        make = alloca0_align(ALIGN8(offsetof(struct kdbus_cmd, items)) +
-                             ALIGN8(offsetof(struct kdbus_item, str) + DECIMAL_STR_MAX(uid_t) + 1 + strlen(ep_name) + 1),
-                             8);
-        make->size = ALIGN8(offsetof(struct kdbus_cmd, items));
-        make->flags = KDBUS_MAKE_ACCESS_WORLD;
-
-        n = make->items;
-        sprintf(n->str, UID_FMT "-%s", getuid(), ep_name);
-        n->size = offsetof(struct kdbus_item, str) + strlen(n->str) + 1;
-        n->type = KDBUS_ITEM_MAKE_NAME;
-        make->size += ALIGN8(n->size);
-        name = n->str;
-
-        if (ioctl(fd, KDBUS_CMD_ENDPOINT_MAKE, make) < 0) {
-                safe_close(fd);
-                return -errno;
-        }
-
-        if (ep_path) {
-                char *p;
-
-                p = strjoin(dirname(path), "/", name, NULL);
-                if (!p) {
-                        safe_close(fd);
-                        return -ENOMEM;
-                }
-
-                *ep_path = p;
-        }
-
-        return fd;
-}
-#endif // 0
-
 int bus_kernel_try_close(sd_bus *bus) {
         struct kdbus_cmd byebye = { .size = sizeof(byebye) };