From d8cf23b54d7c6e9883f6a823bde87f3ab3c844d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20H=C3=A4rdeman?= Date: Sun, 20 May 2007 00:03:46 +0200 Subject: Improve some error messages. --- utils.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'utils.c') diff --git a/utils.c b/utils.c index de4993e..7b8e784 100644 --- a/utils.c +++ b/utils.c @@ -25,6 +25,7 @@ #include #include #include +#include #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); } } -- cgit v1.2.1