void-packages/srcpkgs/elfutils/patches/musl-strerror_r.patch

20 lines
594 B
Diff

--- libdwfl/dwfl_error.c 2015-09-29 17:18:51.000000000 +0200
+++ libdwfl/dwfl_error.c 2015-11-20 05:11:29.889002058 +0100
@@ -154,7 +154,16 @@
switch (error &~ 0xffff)
{
case OTHER_ERROR (ERRNO):
+#if defined(__GLIBC__)
return strerror_r (error & 0xffff, "bad", 0);
+#else
+ {
+ static __thread char buf[128] = "";
+ if (0 == strerror_r(error & 0xffff, buf, sizeof(buf)))
+ return buf;
+ }
+ return "strerror_r() failed";
+#endif
case OTHER_ERROR (LIBELF):
return elf_errmsg (error & 0xffff);
case OTHER_ERROR (LIBDW):