diff options
author | David Härdeman <david@hardeman.nu> | 2007-05-20 00:03:46 +0200 |
---|---|---|
committer | David Härdeman <david@hardeman.nu> | 2007-05-20 00:03:46 +0200 |
commit | d8cf23b54d7c6e9883f6a823bde87f3ab3c844d0 (patch) | |
tree | a286e6fdbd89c4e571cd1d981da9ea83ef90c5af /utils.c | |
parent | e435c45fe0f3eac66f564a3f5815191a2fbc05cf (diff) |
Improve some error messages.
Diffstat (limited to 'utils.c')
-rw-r--r-- | utils.c | 4 |
1 files changed, 3 insertions, 1 deletions
@@ -25,6 +25,7 @@ #include <stdint.h> #include <stdarg.h> #include <unistd.h> +#include <errno.h> #include "utils.h" @@ -105,7 +106,8 @@ void xfwrite(const void *ptr, size_t size, FILE *stream) { if (fwrite(ptr, size, 1, stream) != 1) { - perror("fwrite"); + msg(MSG_CRITICAL, "Failed to write to file: %s\n", + strerror(errno)); exit(EXIT_FAILURE); } } |