summaryrefslogtreecommitdiff
path: root/common/compat.c
diff options
context:
space:
mode:
authorStef Walter <stef@thewalter.net>2013-07-17 18:08:11 +0200
committerStef Walter <stef@thewalter.net>2013-07-18 13:04:37 +0200
commit9a1fe66f08149596567fedb4e2338ae786a19ab9 (patch)
tree562ee2eedc17f0dd83f62890d3b4d12f02ee5a72 /common/compat.c
parente403f7b33ac35e961c72ed1b6335bbe3084e4642 (diff)
downloadp11-kit-9a1fe66f08149596567fedb4e2338ae786a19ab9.tar.gz
Avoid using the non-thread-safe strerror() function
https://bugzilla.redhat.com/show_bug.cgi?id=985481
Diffstat (limited to 'common/compat.c')
-rw-r--r--common/compat.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/common/compat.c b/common/compat.c
index 3b1361c..e7bee3c 100644
--- a/common/compat.c
+++ b/common/compat.c
@@ -807,3 +807,19 @@ getauxval (unsigned long type)
}
#endif /* HAVE_GETAUXVAL */
+
+#ifndef HAVE_STRERROR_R
+
+int
+strerror_r (int errnum,
+ char *buf,
+ size_t buflen)
+{
+#ifdef OS_WIN32
+ return strerror_s (buf, buflen, errnum);
+#else
+ #error no strerror_r implementation
+#endif
+}
+
+#endif /* HAVE_STRERROR_R */