diff options
author | Sami Kerola | 2011-04-10 12:16:11 +0200 |
---|---|---|
committer | Karel Zak | 2011-04-14 13:20:25 +0200 |
commit | 7c45597f918e4a31dc4f6a101ac8f3febf6841e6 (patch) | |
tree | b714026d2aec1f68b6753dc5ab4f242a0ea69432 /term-utils | |
parent | agetty: use long options (diff) | |
download | kernel-qcow2-util-linux-7c45597f918e4a31dc4f6a101ac8f3febf6841e6.tar.gz kernel-qcow2-util-linux-7c45597f918e4a31dc4f6a101ac8f3febf6841e6.tar.xz kernel-qcow2-util-linux-7c45597f918e4a31dc4f6a101ac8f3febf6841e6.zip |
agetty: error message about required arguments
This patch also fixes only remaining magical number to EXIT_*
markup.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'term-utils')
-rw-r--r-- | term-utils/agetty.c | 9 |
1 files changed, 6 insertions, 3 deletions
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); } |