diff options
author | David Tardon <dtardon@redhat.com> | 2023-04-11 17:25:42 +0200 |
---|---|---|
committer | David Tardon <dtardon@redhat.com> | 2023-04-12 09:53:55 +0200 |
commit | 5e891cbb5cfb0de54588988f1c9969244a9317a3 (patch) | |
tree | 9fd735d8f5c3e0d76d8530e259baae842c6fef6d /src/shared/bus-unit-util.c | |
parent | f643ca1767a52918c69c324f2ed6dbdfa005f04e (diff) | |
download | systemd-5e891cbb5cfb0de54588988f1c9969244a9317a3.tar.gz |
tree-wide: drop unneeded output params
Neither of the callers of bus_deserialize_and_dump_unit_file_changes()
touches the changes array, so let's simplify things and keep it internal
to the function.
Diffstat (limited to 'src/shared/bus-unit-util.c')
-rw-r--r-- | src/shared/bus-unit-util.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/shared/bus-unit-util.c b/src/shared/bus-unit-util.c index 6966cfd838..3307691f28 100644 --- a/src/shared/bus-unit-util.c +++ b/src/shared/bus-unit-util.c @@ -2708,14 +2708,13 @@ int bus_append_unit_property_assignment_many(sd_bus_message *m, UnitType t, char return 0; } -int bus_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet, InstallChange **changes, size_t *n_changes) { +int bus_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet) { const char *type, *path, *source; + InstallChange *changes = NULL; + size_t n_changes = 0; int r; - /* changes is dereferenced when calling install_changes_dump() later, - * so we have to make sure this is not NULL. */ - assert(changes); - assert(n_changes); + CLEANUP_ARRAY(changes, n_changes, install_changes_free); r = sd_bus_message_enter_container(m, SD_BUS_TYPE_ARRAY, "(sss)"); if (r < 0) @@ -2733,7 +2732,7 @@ int bus_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet, In continue; } - r = install_changes_add(changes, n_changes, t, path, source); + r = install_changes_add(&changes, &n_changes, t, path, source); if (r < 0) return r; } @@ -2744,7 +2743,8 @@ int bus_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet, In if (r < 0) return bus_log_parse_error(r); - install_changes_dump(0, NULL, *changes, *n_changes, quiet); + install_changes_dump(0, NULL, changes, n_changes, quiet); + return 0; } |