X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fsystemctl%2Fsystemctl.c;h=1717c1929ee15396f32ad039c04236bd38fbd2ce;hp=ee0938f239dc082a811e69699ceec267fb76f9f9;hb=c5220a940d00fc2520c702104939d0a4cf637254;hpb=806a37e743a038c0fd0887c24c8b1b6914cb109d diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index ee0938f23..1717c1929 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -1968,7 +1968,7 @@ static int set_default(sd_bus *bus, char **args) { return log_oom(); if (!bus || avoid_bus()) { - r = unit_file_set_default(arg_scope, arg_root, unit, arg_force, &changes, &n_changes); + r = unit_file_set_default(arg_scope, arg_root, unit, true, &changes, &n_changes); if (r < 0) { log_error("Failed to set default target: %s", strerror(-r)); return r; @@ -1990,7 +1990,7 @@ static int set_default(sd_bus *bus, char **args) { "SetDefaultTarget", &error, &reply, - "sb", unit, arg_force); + "sb", unit, true); if (r < 0) { log_error("Failed to set default target: %s", bus_error_message(&error, -r)); return r; @@ -6018,13 +6018,10 @@ static int halt_parse_argv(int argc, char *argv[]) { } } - if (arg_action == ACTION_REBOOT && argc == optind + 1) { - r = write_string_file(REBOOT_PARAM_FILE, argv[optind]); - if (r < 0) { - log_error("Failed to write reboot param to " - REBOOT_PARAM_FILE": %s", strerror(-r)); + if (arg_action == ACTION_REBOOT && (argc == optind || argc == optind + 1)) { + r = update_reboot_param_file(argc == optind + 1 ? argv[optind] : NULL); + if (r < 0) return r; - } } else if (optind < argc) { log_error("Too many arguments."); return -EINVAL;