chiark / gitweb /
bus-proxy: rename synthetic_reply_return_strv() to synthetic_reply_method_return_strv()
[elogind.git] / src / bus-proxyd / driver.c
index 5287ff1..bc2c0c8 100644 (file)
@@ -305,7 +305,7 @@ int bus_proxy_process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m, SharedPoli
                 /* Let's sort the names list to make it stable */
                 strv_sort(names);
 
-                return synthetic_reply_return_strv(m, names);
+                return synthetic_reply_method_return_strv(m, names);
 
         } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "ListNames")) {
                 _cleanup_strv_free_ char **names = NULL;
@@ -324,12 +324,14 @@ int bus_proxy_process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m, SharedPoli
                 /* Let's sort the names list to make it stable */
                 strv_sort(names);
 
-                return synthetic_reply_return_strv(m, names);
+                return synthetic_reply_method_return_strv(m, names);
 
         } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "ListQueuedOwners")) {
-                struct kdbus_cmd_name_list cmd = {};
-                struct kdbus_name_list *name_list;
-                struct kdbus_name_info *name;
+                struct kdbus_cmd_list cmd = {
+                        .flags = KDBUS_LIST_QUEUED,
+                        .size = sizeof(cmd),
+                };
+                struct kdbus_info *name_list, *name;
                 _cleanup_strv_free_ char **owners = NULL;
                 _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
                 char *arg0;
@@ -350,14 +352,13 @@ int bus_proxy_process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m, SharedPoli
                 if (r < 0)
                         return synthetic_reply_method_errno(m, r, NULL);
 
-                cmd.flags = KDBUS_NAME_LIST_QUEUED;
-                r = ioctl(a->input_fd, KDBUS_CMD_NAME_LIST, &cmd);
+                r = ioctl(a->input_fd, KDBUS_CMD_LIST, &cmd);
                 if (r < 0)
                         return synthetic_reply_method_errno(m, -errno, NULL);
 
-                name_list = (struct kdbus_name_list *) ((uint8_t *) a->kdbus_buffer + cmd.offset);
+                name_list = (struct kdbus_info *) ((uint8_t *) a->kdbus_buffer + cmd.offset);
 
-                KDBUS_ITEM_FOREACH(name, name_list, names) {
+                KDBUS_FOREACH(name, name_list, cmd.list_size) {
                         const char *entry_name = NULL;
                         struct kdbus_item *item;
                         char *n;
@@ -369,7 +370,7 @@ int bus_proxy_process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m, SharedPoli
                         if (!streq_ptr(entry_name, arg0))
                                 continue;
 
-                        if (asprintf(&n, ":1.%llu", (unsigned long long) name->owner_id) < 0) {
+                        if (asprintf(&n, ":1.%llu", (unsigned long long) name->id) < 0) {
                                 err  = -ENOMEM;
                                 break;
                         }
@@ -388,7 +389,7 @@ int bus_proxy_process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m, SharedPoli
                 if (err < 0)
                         return synthetic_reply_method_errno(m, err, NULL);
 
-                return synthetic_reply_return_strv(m, owners);
+                return synthetic_reply_method_return_strv(m, owners);
 
         } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "NameHasOwner")) {
                 const char *name;
@@ -434,8 +435,6 @@ int bus_proxy_process_driver(sd_bus *a, sd_bus *b, sd_bus_message *m, SharedPoli
                 return synthetic_reply_method_return(m, "u", BUS_NAME_RELEASED);
 
         } else if (sd_bus_message_is_method_call(m, "org.freedesktop.DBus", "ReloadConfig")) {
-                _cleanup_bus_error_free_ sd_bus_error error = SD_BUS_ERROR_NULL;
-
                 if (!sd_bus_message_has_signature(m, ""))
                         return synthetic_reply_method_error(m, &SD_BUS_ERROR_MAKE_CONST(SD_BUS_ERROR_INVALID_ARGS, "Invalid parameters"));