void-packages/srcpkgs/snapper/patches/musl-strerror_r.patch
2015-08-30 15:43:18 +02:00

14 lines
591 B
Diff

In musl libc the return type of strerror_r(2) is int (XSI-compliant).
We define MUSL_LIBC in CXXFLAGS to skip the wrong #else implementation.
--- snapper/AppUtil.cc 2015-08-30 15:34:51.106531190 +0200
+++ snapper/AppUtil.cc 2015-08-30 15:35:41.996532260 +0200
@@ -209,7 +209,7 @@
string
stringerror(int errnum)
{
-#if (_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && ! _GNU_SOURCE
+#if ((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && ! _GNU_SOURCE) || MUSL_LIBC
char buf1[100];
if (strerror_r(errno, buf1, sizeof(buf1)-1) == 0)
return string(buf1);