chiark / gitweb /
libsystemd-bus: catch up with latest kdbus changes
authorDaniel Mack <zonque@gmail.com>
Tue, 3 Dec 2013 13:38:53 +0000 (14:38 +0100)
committerDaniel Mack <zonque@gmail.com>
Tue, 3 Dec 2013 13:38:53 +0000 (14:38 +0100)
src/libsystemd-bus/bus-control.c
src/libsystemd-bus/kdbus.h

index aaddb7d374a93de9b28680bd342aa00ea7c60ce4..5cb32eaa4c07a62c629f153d327df528fe80e27b 100644 (file)
@@ -178,10 +178,11 @@ _public_ int sd_bus_list_names(sd_bus *bus, char ***l) {
                 struct kdbus_name_list *name_list;
                 struct kdbus_cmd_name *name;
 
-                cmd = malloc0(sizeof(struct kdbus_cmd_name_list *));
+                cmd = malloc0(sizeof(struct kdbus_cmd_name_list));
                 if (!cmd)
                         return -ENOMEM;
 
+                cmd->size = sizeof(struct kdbus_cmd_name_list);
                 cmd->flags = KDBUS_NAME_LIST_UNIQUE | KDBUS_NAME_LIST_NAMES;
 
                 r = ioctl(sd_bus_get_fd(bus), KDBUS_CMD_NAME_LIST, cmd);
index 09a73fa1093ccf96c13e1fffafce17fb53e01d8b..1a294f61d1fc1c00ab359ea4c80fe8d051651ea8 100644 (file)
@@ -452,6 +452,7 @@ enum {
 
 /**
  * struct kdbus_cmd_name_list - request a list of name entries
+ * @size       Total size of the struct
  * @flags:     Flags for the query (KDBUS_NAME_LIST_*)
  * @offset:    The returned offset in the caller's pool buffer.
  *             The user must use KDBUS_CMD_FREE to free the
@@ -463,6 +464,7 @@ enum {
  * Refer to the documentation for more information.
  */
 struct kdbus_cmd_name_list {
+       __u64 size;
        __u64 flags;
        __u64 offset;
        char name[0];