summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
Diffstat (limited to 'util.c')
-rw-r--r--util.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/util.c b/util.c
index 193cb8f..6f5e11f 100644
--- a/util.c
+++ b/util.c
@@ -444,23 +444,15 @@ void warning (char const *m)
void read_error()
{
- int e = errno;
- fprintf (stderr, "\n%s: ", program_name);
- if (e != 0) {
- errno = e;
- perror(ifname);
- } else {
- fprintf(stderr, "%s: unexpected end of file\n", ifname);
- }
+ fprintf (stderr, "\n%s: %s: %s\n",
+ program_name, ifname,
+ errno ? strerror (errno) : "unexpected end of file");
abort_gzip();
}
void write_error()
{
- int e = errno;
- fprintf (stderr, "\n%s: ", program_name);
- errno = e;
- perror(ofname);
+ fprintf (stderr, "\n%s: %s: %s\n", program_name, ofname, strerror (errno));
abort_gzip();
}