]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
agetty: error message about required arguments
authorSami Kerola <kerolasa@iki.fi>
Sun, 10 Apr 2011 10:16:11 +0000 (12:16 +0200)
committerKarel Zak <kzak@redhat.com>
Thu, 14 Apr 2011 11:20:25 +0000 (13:20 +0200)
This patch also fixes only remaining magical number to EXIT_*
markup.

Signed-off-by: Sami Kerola <kerolasa@iki.fi>
term-utils/agetty.c

index 5020d7f4ede02b0e383345f92baa07f9978d37be..5c602fcbe8fb8e5a656d45f553922d534a20ff8f 100644 (file)
@@ -477,9 +477,12 @@ parse_args(argc, argv, op)
            usage(stderr);
        }
     }
-       debug("after getopt loop\n");
-    if (argc < optind + 2)                     /* check parameter count */
+    debug("after getopt loop\n");
+
+    if (argc < optind + 2) {                   /* check parameter count */
+       warnx(_("not enough arguments"));
        usage(stderr);
+    }
 
     /* we loosen up a bit and accept both "baudrate tty" and "tty baudrate" */
     if('0' <= argv[optind][0] && argv[optind][0] <= '9') {
@@ -1339,5 +1342,5 @@ error(const char *fmt, ...) {
     }
 #endif
     (void) sleep((unsigned) 10);               /* be kind to init(8) */
-    exit(1);
+    exit(EXIT_FAILURE);
 }