From 7c45597f918e4a31dc4f6a101ac8f3febf6841e6 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sun, 10 Apr 2011 12:16:11 +0200 Subject: agetty: error message about required arguments This patch also fixes only remaining magical number to EXIT_* markup. Signed-off-by: Sami Kerola --- term-utils/agetty.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'term-utils/agetty.c') diff --git a/term-utils/agetty.c b/term-utils/agetty.c index 5020d7f4e..5c602fcbe 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); } -- cgit v1.2.3-55-g7522