blob: 9424be2aa65e5c2dbf43e6ae46653eb7546841e1 [file] [log] [blame]
Andrew Geissler87f5cff2022-09-30 13:13:31 -05001From e5ccf769c2dc7283b56a597fffdb5dc1558e3ce8 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sat, 3 Sep 2022 01:23:28 -0700
4Subject: [PATCH] src/internal: Use __GLIBC__ to check for GNU extention
5 implementation
6
7__USE_GNU is defined by _GNU_SOURCE and configure explicitly sets this
8macro and it does have meaning on musl too, where it may have some level
9of GNU compatibility but strerror_r is not one of them. Therefore we
10have to check for libc implementation for this to be sure.
11
12Upstream-Status: Pending
13
14Signed-off-by: Khem Raj <raj.khem@gmail.com>
15---
16 src/internal.c | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
18
19diff --git a/src/internal.c b/src/internal.c
20index ef83b71..fb326fa 100644
21--- a/src/internal.c
22+++ b/src/internal.c
23@@ -431,7 +431,7 @@ char *cleanpath(char *path) {
24
25 const char *xstrerror(int errnum, char *buf, size_t len) {
26 #ifdef HAVE_STRERROR_R
27-# ifdef __USE_GNU
28+# ifdef __GLIBC__
29 /* Annoying linux specific API contract */
30 return strerror_r(errnum, buf, len);
31 # else
32--
332.37.3
34