diff options
author | Sami Kerola | 2014-05-18 15:04:03 +0200 |
---|---|---|
committer | Sami Kerola | 2014-05-19 23:54:23 +0200 |
commit | cda2b5b951fff09b1f02c3d52814de14df1fb214 (patch) | |
tree | 94f48d3278ceaf3f017ce7805ceb035cb6b6e9c1 /term-utils/setterm.c | |
parent | setterm: tell user when options does not effect (diff) | |
download | kernel-qcow2-util-linux-cda2b5b951fff09b1f02c3d52814de14df1fb214.tar.gz kernel-qcow2-util-linux-cda2b5b951fff09b1f02c3d52814de14df1fb214.tar.xz kernel-qcow2-util-linux-cda2b5b951fff09b1f02c3d52814de14df1fb214.zip |
setterm: improve error messages
Reuse messages to make translation work easier.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'term-utils/setterm.c')
-rw-r--r-- | term-utils/setterm.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/term-utils/setterm.c b/term-utils/setterm.c index 14a0854b0..eeab7ec4c 100644 --- a/term-utils/setterm.c +++ b/term-utils/setterm.c @@ -253,7 +253,7 @@ static int parse_ulhb_color(char **argv, int *optind) else { color = strtos32_or_err(color_name, _("argument error")); if (color < BLACK || DEFAULT < color) - errx(EXIT_FAILURE, _("argument error")); + errx(EXIT_FAILURE, _("argument error: %s"), color_name); } if (bright && (color == BLACK || color == GREY)) errx(EXIT_FAILURE, _("argument error: bright %s is not supported"), color_name); @@ -720,7 +720,7 @@ static int open_snapshot_device(struct setterm_control *ctl) xasprintf(&ctl->in_device, "/dev/vcsa"); fd = open(ctl->in_device, O_RDONLY); if (fd < 0) - err(EXIT_DUMPFILE, _("Couldn't read %s"), ctl->in_device); + err(EXIT_DUMPFILE, _("cannot read %s"), ctl->in_device); return fd; } @@ -744,18 +744,18 @@ static void screendump(struct setterm_control *ctl) err(EXIT_DUMPFILE, _("can not open dump file %s for output"), ctl->opt_sn_name); /* determine snapshot size */ if (read(fd, header, 4) != 4) - err(EXIT_DUMPFILE, _("Couldn't read %s"), ctl->in_device); + err(EXIT_DUMPFILE, _("cannot read %s"), ctl->in_device); rows = header[0]; cols = header[1]; if (rows * cols == 0) - err(EXIT_DUMPFILE, _("Couldn't read %s"), ctl->in_device); + err(EXIT_DUMPFILE, _("cannot read %s"), ctl->in_device); /* allocate buffers */ inbuf = xmalloc(rows * cols * 2); outbuf = xmalloc(rows * (cols + 1)); /* read input */ rc = read(fd, inbuf, rows * cols * 2); if (rc < 0 || (size_t)rc != rows * cols * 2) - err(EXIT_DUMPFILE, _("Couldn't read %s"), ctl->in_device); + err(EXIT_DUMPFILE, _("cannot read %s"), ctl->in_device); p = inbuf; q = outbuf; /* copy inbuf to outbuf */ |