summaryrefslogtreecommitdiffstats
path: root/term-utils/agetty.c
diff options
context:
space:
mode:
authorSami Kerola2017-07-30 15:59:24 +0200
committerSami Kerola2017-08-05 17:49:07 +0200
commit82214f45e93c1987796621b389555df7920c4fc0 (patch)
treeb98759e26b6b63568f74c96fbdb83c14c4a7ca8c /term-utils/agetty.c
parentagetty: add compile time features to --version output (diff)
downloadkernel-qcow2-util-linux-82214f45e93c1987796621b389555df7920c4fc0.tar.gz
kernel-qcow2-util-linux-82214f45e93c1987796621b389555df7920c4fc0.tar.xz
kernel-qcow2-util-linux-82214f45e93c1987796621b389555df7920c4fc0.zip
agetty: fix invalid usage crash
$ agetty agetty: not enough arguments: Success Segmentation fault (core dumped) Reference: 9325dbfd2018b2a3b510617f4aa13777fbbe23c3 Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'term-utils/agetty.c')
-rw-r--r--term-utils/agetty.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/term-utils/agetty.c b/term-utils/agetty.c
index 732a46838..3c3764b8e 100644
--- a/term-utils/agetty.c
+++ b/term-utils/agetty.c
@@ -847,7 +847,7 @@ static void parse_args(int argc, char **argv, struct options *op)
if (argc < optind + 1) {
log_warn(_("not enough arguments"));
- warn(_("not enough arguments"));
+ errx(EXIT_FAILURE, _("not enough arguments"));
}
/* Accept "tty", "baudrate tty", and "tty baudrate". */
@@ -856,7 +856,7 @@ static void parse_args(int argc, char **argv, struct options *op)
parse_speeds(op, argv[optind++]);
if (argc < optind + 1) {
log_warn(_("not enough arguments"));
- warn(_("not enough arguments"));
+ errx(EXIT_FAILURE, _("not enough arguments"));
}
op->tty = argv[optind++];
} else {