mirror of
https://github.com/jemalloc/jemalloc.git
synced 2026-05-30 08:37:29 +03:00
util.c: strerror_r returns char* only on glibc
This commit is contained in:
parent
5b8ed5b7c9
commit
008267b9f6
1 changed files with 1 additions and 1 deletions
|
|
@ -84,7 +84,7 @@ buferror(int err, char *buf, size_t buflen)
|
|||
FormatMessageA(FORMAT_MESSAGE_FROM_SYSTEM, NULL, GetLastError(), 0,
|
||||
(LPSTR)buf, buflen, NULL);
|
||||
return (0);
|
||||
#elif defined(_GNU_SOURCE)
|
||||
#elif defined(__GLIBC__) && defined(_GNU_SOURCE)
|
||||
char *b = strerror_r(err, buf, buflen);
|
||||
if (b != buf) {
|
||||
strncpy(buf, b, buflen);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue