From cda2b5b951fff09b1f02c3d52814de14df1fb214 Mon Sep 17 00:00:00 2001 From: Sami Kerola Date: Sun, 18 May 2014 14:04:03 +0100 Subject: setterm: improve error messages Reuse messages to make translation work easier. Signed-off-by: Sami Kerola --- term-utils/setterm.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'term-utils/setterm.c') 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 */ -- cgit v1.2.3-55-g7522