aboutsummaryrefslogtreecommitdiffstats
path: root/src/world.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/world.c')
-rw-r--r--src/world.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/world.c b/src/world.c
index 71fd32c8..e14a04c9 100644
--- a/src/world.c
+++ b/src/world.c
@@ -17,6 +17,7 @@
#include "world.h"
#include "serd_config.h"
+#include "system.h"
#if defined(USE_POSIX_FADVISE)
# include <fcntl.h>
@@ -26,18 +27,17 @@
#include <stdarg.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
FILE*
serd_world_fopen(SerdWorld* world, const char* path, const char* mode)
{
FILE* fd = fopen(path, mode);
if (!fd) {
- serd_world_errorf(world,
- SERD_ERR_INTERNAL,
- "failed to open file %s (%s)\n",
- path,
- strerror(errno));
+ char message[1024] = {0};
+ serd_system_strerror(errno, message, sizeof(message));
+
+ serd_world_errorf(
+ world, SERD_ERR_INTERNAL, "failed to open file %s (%s)\n", path, message);
return NULL;
}