diff options
author | Sami Kerola | 2014-12-07 11:13:03 +0100 |
---|---|---|
committer | Karel Zak | 2014-12-09 09:19:22 +0100 |
commit | 338a6bc55b277598fb9e63a42f442d026b255e59 (patch) | |
tree | ab1d173f7706858e7803653fe4a5571f0106f661 /text-utils/more.c | |
parent | login-utils: use libc error printing facility (diff) | |
download | kernel-qcow2-util-linux-338a6bc55b277598fb9e63a42f442d026b255e59.tar.gz kernel-qcow2-util-linux-338a6bc55b277598fb9e63a42f442d026b255e59.tar.xz kernel-qcow2-util-linux-338a6bc55b277598fb9e63a42f442d026b255e59.zip |
textual: improve error messages
Use error printing facilities that add command name in front of the error
message, and add explanation that is part of existing translations.
Signed-off-by: Sami Kerola <kerolasa@iki.fi>
Diffstat (limited to 'text-utils/more.c')
-rw-r--r-- | text-utils/more.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/text-utils/more.c b/text-utils/more.c index a489953b5..8c0853c14 100644 --- a/text-utils/more.c +++ b/text-utils/more.c @@ -591,7 +591,7 @@ FILE *checkf(register char *fs, int *clearfirst) fflush(stdout); if (clreol) cleareol(); - perror(fs); + warn(_("stat failed %s"), fs); return ((FILE *)NULL); } if ((stbuf.st_mode & S_IFMT) == S_IFDIR) { @@ -600,7 +600,7 @@ FILE *checkf(register char *fs, int *clearfirst) } if ((f = Fopen(fs, "r")) == NULL) { fflush(stdout); - perror(fs); + warn(_("cannot open %s"), fs); return ((FILE *)NULL); } if (magic(f, fs)) { @@ -1781,10 +1781,8 @@ void initterm(void) int tgrp; /* Wait until we're in the foreground before we * save the terminal modes. */ - if ((tgrp = tcgetpgrp(fileno(stdout))) < 0) { - perror("tcgetpgrp"); - exit(EXIT_FAILURE); - } + if ((tgrp = tcgetpgrp(fileno(stdout))) < 0) + err(EXIT_FAILURE, "tcgetpgrp"); if (tgrp != getpgrp(0)) { kill(0, SIGTTOU); goto retry; |