aboutsummaryrefslogtreecommitdiffstats
path: root/src/writer.c
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2021-07-09 22:29:55 -0400
committerDavid Robillard <d@drobilla.net>2023-12-02 18:49:07 -0500
commit6ea89ed78d344d01de4566ae7cc690c0cfe5673e (patch)
tree98f856a191ab2d7609f249aeb0fa3b3e1c1e340e /src/writer.c
parent1a95f759fe3d642e8520e41e691e63f22a2f3b99 (diff)
downloadserd-6ea89ed78d344d01de4566ae7cc690c0cfe5673e.tar.gz
serd-6ea89ed78d344d01de4566ae7cc690c0cfe5673e.tar.bz2
serd-6ea89ed78d344d01de4566ae7cc690c0cfe5673e.zip
Use thread-safe strerror_r() if available
Diffstat (limited to 'src/writer.c')
-rw-r--r--src/writer.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/writer.c b/src/writer.c
index 9c076c11..ced64adc 100644
--- a/src/writer.c
+++ b/src/writer.c
@@ -8,6 +8,7 @@
#include "sink.h"
#include "stack.h"
#include "string_utils.h"
+#include "system.h"
#include "try.h"
#include "uri_utils.h"
#include "world.h"
@@ -257,7 +258,9 @@ sink(const void* buf, size_t len, SerdWriter* writer)
const size_t written = serd_byte_sink_write(buf, len, &writer->byte_sink);
if (written != len) {
if (errno) {
- const char* const message = strerror(errno);
+ char message[1024] = {0};
+ serd_system_strerror(errno, message, sizeof(message));
+
w_err(writer, SERD_BAD_WRITE, "write error (%s)\n", message);
} else {
w_err(writer, SERD_BAD_WRITE, "write error\n");