diff options
author | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-04-17 15:43:16 -0400 |
---|---|---|
committer | Zbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl> | 2016-04-18 23:35:51 -0400 |
commit | 596fc2636a898c0948cb9d2b3d3e7972084bc992 (patch) | |
tree | ab2ad444048dab2fb9d3eef327f1526ccba99c76 /src/systemctl | |
parent | 24737c291738313fd67924172988a8986f60e958 (diff) |
Various formatting and style fixes
Diffstat (limited to 'src/systemctl')
-rw-r--r-- | src/systemctl/systemctl.c | 29 |
1 files changed, 11 insertions, 18 deletions
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 0c64cbab80..5f87e4a97f 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -5684,23 +5684,22 @@ static int add_dependency(int argc, char *argv[], void *userdata) { } static int preset_all(int argc, char *argv[], void *userdata) { - UnitFileChange *changes = NULL; - unsigned n_changes = 0; int r; if (install_client_side()) { + UnitFileChange *changes = NULL; + unsigned n_changes = 0; r = unit_file_preset_all(arg_scope, arg_runtime, arg_root, arg_preset_mode, arg_force, &changes, &n_changes); - if (r < 0) { + if (r < 0) log_error_errno(r, "Operation failed: %m"); - goto finish; + else { + if (!arg_quiet) + dump_unit_file_changes(changes, n_changes); } - if (!arg_quiet) - dump_unit_file_changes(changes, n_changes); - - r = 0; - + unit_file_changes_free(changes, n_changes); + return r; } else { _cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL; _cleanup_(sd_bus_message_unrefp) sd_bus_message *reply = NULL; @@ -5731,16 +5730,10 @@ static int preset_all(int argc, char *argv[], void *userdata) { if (r < 0) return r; - if (!arg_no_reload) - r = daemon_reload(argc, argv, userdata); - else - r = 0; + if (arg_no_reload) + return 0; + return daemon_reload(argc, argv, userdata); } - -finish: - unit_file_changes_free(changes, n_changes); - - return r; } static int unit_is_enabled(int argc, char *argv[], void *userdata) { |