Skip to content
Snippets Groups Projects
Commit 746ccfd5 authored by Deucе's avatar Deucе :ok_hand_tone4:
Browse files

Attempt to fix musl builds

The non-standard strerror_r() is glibc specific, musl doesn't do
that.  It *appears* that __USE_GNU implies glibc.
parent 9f5dbd66
No related branches found
No related tags found
No related merge requests found
Pipeline #7386 passed
......@@ -1166,7 +1166,7 @@ char* safe_strerror(int errnum, char *buf, size_t buflen)
strerror_s(buf, buflen, errnum);
#elif defined(_WIN32) || defined(__EMSCRIPTEN__)
strlcpy(buf, strerror(errnum), buflen);
#elif defined(_GNU_SOURCE)
#elif defined(_GNU_SOURCE) && defined(__USE_GNU)
char* ret = strerror_r(errnum, buf, buflen);
if (ret != buf)
strlcpy(buf, ret, buflen);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment