void-packages/srcpkgs/snapper/patches/musl-strerror_r.patch

15 lines
562 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 2019-01-26 13:29:29.110490961 +0200
+++ snapper/AppUtil.cc 2019-01-26 13:29:51.324648467 +0200
@@ -223,7 +223,7 @@ namespace snapper
string
stringerror(int errnum)
{
-#if (_POSIX_C_SOURCE >= 200112L) && ! _GNU_SOURCE
+#if (_POSIX_C_SOURCE >= 200112L) && ! _GNU_SOURCE || MUSL_LIBC
char buf1[100];
if (strerror_r(errnum, buf1, sizeof(buf1) - 1) == 0)
return string(buf1);