From: Sami Kerola Date: Sun, 10 Apr 2011 10:16:11 +0000 (+0200) Subject: agetty: error message about required arguments X-Git-Tag: v2.20-rc1~339 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=7c45597f918e4a31dc4f6a101ac8f3febf6841e6;p=thirdparty%2Futil-linux.git agetty: error message about required arguments This patch also fixes only remaining magical number to EXIT_* markup. Signed-off-by: Sami Kerola --- diff --git a/term-utils/agetty.c b/term-utils/agetty.c index 5020d7f4ed..5c602fcbe8 100644 --- a/term-utils/agetty.c +++ b/term-utils/agetty.c @@ -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); }