aports/testing/dnsperf/musl-perf_strerror_r.patch
Celeste dff8101164 testing/dnsperf: fix build with gcc 14
musl uses POSIX strerror_r, causing an int-conversion error

patch the source directly instead of messing with defines
2024-09-29 08:25:37 +00:00

17 lines
460 B
Diff

musl uses POSIX strerror_r
--- a/src/strerror.c
+++ b/src/strerror.c
@@ -26,12 +26,8 @@
const char* perf_strerror_r(int errnum, char* str, size_t len)
{
-#if ((_POSIX_C_SOURCE >= 200112L) && !_GNU_SOURCE) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__APPLE__)
if (strerror_r(errnum, str, len)) {
(void)snprintf(str, len, "Error %d", errnum);
}
return str;
-#else
- return strerror_r(errnum, str, len);
-#endif
}