]> err.no Git - systemd/commitdiff
shutdown: if now time argument is passed, imply +1 not +0
authorLennart Poettering <lennart@poettering.net>
Mon, 16 Aug 2010 15:12:35 +0000 (17:12 +0200)
committerLennart Poettering <lennart@poettering.net>
Mon, 16 Aug 2010 15:12:40 +0000 (17:12 +0200)
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

man/shutdown.xml
src/shutdownd.c
src/systemctl.c

index 95884921ace4dac99f32132cd5b429e723a23fa5..c48e14187907770fab083a9c4b7382a339aa249e 100644 (file)
@@ -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
index 241c4327a628c4413d1df943b2e4686b6e205fc7..751a1a59b8d83e98b62f79d8eccd690af27a3146 100644 (file)
@@ -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;
         }
 
index e517031ceac0d5af15d65e5838e119014888c776..2b34798d060b35fb3e4531bb9ffcabe32076dbc5 100644 (file)
@@ -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)