mirror of
https://github.com/janet-lang/janet
synced 2024-12-24 07:20:27 +00:00
Fix janet_strerror when _GNU_SOURCE defined.
This commit is contained in:
parent
60e0c8ea92
commit
ae2c5820a1
@ -958,6 +958,9 @@ const char *janet_strerror(int e) {
|
||||
#ifdef JANET_WINDOWS
|
||||
/* Microsoft strerror seems sane here and is thread safe by default */
|
||||
return strerror(e);
|
||||
#elif defined(_GNU_SOURCE)
|
||||
/* See https://linux.die.net/man/3/strerror_r */
|
||||
return strerror_r(e, janet_vm.strerror_buf, sizeof(janet_vm.strerror_buf));
|
||||
#else
|
||||
strerror_r(e, janet_vm.strerror_buf, sizeof(janet_vm.strerror_buf));
|
||||
return janet_vm.strerror_buf;
|
||||
|
Loading…
Reference in New Issue
Block a user