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=1b381f7a90680d6a661fcff02c2916601b4b5e7c;hb=c5220a940d00fc2520c702104939d0a4cf637254;hpb=a1484a216e79da1fa7e2323095fb1b7203fb7a17 diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c index 1b381f7a9..1717c1929 100644 --- a/src/systemctl/systemctl.c +++ b/src/systemctl/systemctl.c @@ -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;