2016-12-29 03:53:45 +00:00
|
|
|
https://sourceware.org/bugzilla/show_bug.cgi?id=21002
|
|
|
|
|
2018-06-17 09:08:51 +00:00
|
|
|
--- a/lib/system.h
|
|
|
|
+++ b/lib/system.h
|
2018-12-20 17:07:40 +00:00
|
|
|
@@ -30,7 +30,18 @@
|
2017-05-05 23:05:56 +00:00
|
|
|
#define LIB_SYSTEM_H 1
|
2015-06-14 17:43:40 +00:00
|
|
|
|
2018-09-18 04:07:57 +00:00
|
|
|
#include <errno.h>
|
|
|
|
-#include <error.h>
|
2016-12-29 03:53:45 +00:00
|
|
|
+#ifdef HAVE_ERROR_H
|
|
|
|
+#include "error.h"
|
|
|
|
+#else
|
|
|
|
+#include "err.h"
|
2017-05-05 23:05:56 +00:00
|
|
|
+#include <stdio.h>
|
2018-12-20 17:07:40 +00:00
|
|
|
+#define error(status, errno, ...) \
|
|
|
|
+ do { \
|
|
|
|
+ fflush(stdout); \
|
|
|
|
+ warn(__VA_ARGS__); \
|
|
|
|
+ if (status) exit(status); \
|
|
|
|
+ } while(0)
|
2015-06-14 17:43:40 +00:00
|
|
|
+#endif
|
2017-05-05 23:05:56 +00:00
|
|
|
#include <stddef.h>
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <sys/param.h>
|
2018-06-17 09:08:51 +00:00
|
|
|
--- a/libdw/libdw_alloc.c
|
|
|
|
+++ b/libdw/libdw_alloc.c
|
2020-07-11 18:26:14 +00:00
|
|
|
@@ -152,5 +152,5 @@ __attribute ((noreturn)) attribute_hidde
|
2015-06-14 17:43:40 +00:00
|
|
|
__libdw_oom (void)
|
|
|
|
{
|
|
|
|
while (1)
|
|
|
|
- error (EXIT_FAILURE, ENOMEM, "libdw");
|
2016-12-29 03:53:45 +00:00
|
|
|
+ error (EXIT_FAILURE, errno, gettext ("cannot allocate memory"));
|
2015-06-14 17:43:40 +00:00
|
|
|
}
|
2018-06-17 09:08:51 +00:00
|
|
|
--- a/libdwfl/dwfl_error.c
|
|
|
|
+++ b/libdwfl/dwfl_error.c
|
2020-04-06 02:02:38 +00:00
|
|
|
@@ -154,7 +154,11 @@ dwfl_errmsg (int error)
|
2015-06-14 17:43:40 +00:00
|
|
|
switch (error &~ 0xffff)
|
|
|
|
{
|
|
|
|
case OTHER_ERROR (ERRNO):
|
2020-04-06 02:02:38 +00:00
|
|
|
+#if defined(__GLIBC__) && !defined(__UCLIBC__)
|
|
|
|
return strerror_r (error & 0xffff, "bad", 0);
|
|
|
|
+#else
|
|
|
|
+ return strerror (error & 0xffff);
|
|
|
|
+#endif
|
2015-06-14 17:43:40 +00:00
|
|
|
case OTHER_ERROR (LIBELF):
|
|
|
|
return elf_errmsg (error & 0xffff);
|
|
|
|
case OTHER_ERROR (LIBDW):
|