Skip to content

Commit

Permalink
Only use GNU specific strerror_r() API when __GLIBC__ is defined.
Browse files Browse the repository at this point in the history
  • Loading branch information
DimitryAndric committed Dec 8, 2022
1 parent 4f3bbeb commit 46ecd35
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/internal.c
Original file line number Diff line number Diff line change
Expand Up @@ -431,8 +431,8 @@ char *cleanpath(char *path) {

const char *xstrerror(int errnum, char *buf, size_t len) {
#ifdef HAVE_STRERROR_R
# ifdef __USE_GNU
/* Annoying linux specific API contract */
# if defined(__USE_GNU) && defined(__GLIBC__)
/* Annoying GNU specific API contract */
return strerror_r(errnum, buf, len);
# else
strerror_r(errnum, buf, len);
Expand Down

0 comments on commit 46ecd35

Please sign in to comment.