systemctl-preset-all: use CLEANUP_ARRAY
This commit is contained in:
@@ -12,6 +12,8 @@ int verb_preset_all(int argc, char *argv[], void *userdata) {
|
||||
size_t n_changes = 0;
|
||||
int r;
|
||||
|
||||
CLEANUP_ARRAY(changes, n_changes, install_changes_free);
|
||||
|
||||
if (install_client_side()) {
|
||||
r = unit_file_preset_all(arg_runtime_scope, unit_file_flags_from_args(), arg_root, arg_preset_mode, &changes, &n_changes);
|
||||
install_changes_dump(r, "preset", changes, n_changes, arg_quiet);
|
||||
@@ -44,20 +46,15 @@ int verb_preset_all(int argc, char *argv[], void *userdata) {
|
||||
|
||||
r = bus_deserialize_and_dump_unit_file_changes(reply, arg_quiet, &changes, &n_changes);
|
||||
if (r < 0)
|
||||
goto finish;
|
||||
return r;
|
||||
|
||||
if (arg_no_reload) {
|
||||
r = 0;
|
||||
goto finish;
|
||||
}
|
||||
if (arg_no_reload)
|
||||
return 0;
|
||||
|
||||
r = daemon_reload(ACTION_RELOAD, /* graceful= */ false);
|
||||
if (r > 0)
|
||||
r = 0;
|
||||
if (r < 0)
|
||||
return r;
|
||||
}
|
||||
|
||||
finish:
|
||||
install_changes_free(changes, n_changes);
|
||||
|
||||
return r;
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user