summaryrefslogtreecommitdiffstats
path: root/term-utils/agetty.c
diff options
context:
space:
mode:
authorSami Kerola2011-04-10 12:16:11 +0200
committerKarel Zak2011-04-14 13:20:25 +0200
commit7c45597f918e4a31dc4f6a101ac8f3febf6841e6 (patch)
treeb714026d2aec1f68b6753dc5ab4f242a0ea69432 /term-utils/agetty.c
parentagetty: use long options (diff)
downloadkernel-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/agetty.c')
-rw-r--r--term-utils/agetty.c9
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);
}