mirror of
https://github.com/systemd/systemd-stable.git
synced 2025-01-22 22:03:43 +03:00
shutdown: if now time argument is passed, imply +1 not +0
That should friendlier for folks who just run "shutdown" to figure out the command line arguments... https://bugzilla.redhat.com/show_bug.cgi?id=624149
This commit is contained in:
parent
5dc50792ac
commit
6b5ad000ab
@ -72,7 +72,7 @@
|
||||
number of minutes m from now. <literal>now</literal>
|
||||
is an alias for <literal>+0</literal>, i.e. for
|
||||
triggering an immediate shutdown. If no time argument
|
||||
is specified, <literal>now</literal> is
|
||||
is specified, <literal>+1</literal> is
|
||||
implied.</para>
|
||||
|
||||
<para>Note that to specify a wall message you must
|
||||
|
@ -88,7 +88,7 @@ static int read_packet(int fd, struct shutdownd_command *_c) {
|
||||
}
|
||||
|
||||
if (n != sizeof(c)) {
|
||||
log_warning("Message has invaliud size. Ignoring");
|
||||
log_warning("Message has invalid size. Ignoring");
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -4233,11 +4233,13 @@ static int shutdown_parse_argv(int argc, char *argv[]) {
|
||||
}
|
||||
}
|
||||
|
||||
if (argc > optind)
|
||||
if (argc > optind) {
|
||||
if ((r = parse_time_spec(argv[optind], &arg_when)) < 0) {
|
||||
log_error("Failed to parse time specification: %s", argv[optind]);
|
||||
return r;
|
||||
}
|
||||
} else
|
||||
arg_when = USEC_PER_MINUTE;
|
||||
|
||||
/* We skip the time argument */
|
||||
if (argc > optind + 1)
|
||||
|
Loading…
x
Reference in New Issue
Block a user