diff options
author | Ulf Hermann <ulf.hermann@qt.io> | 2017-02-16 18:47:12 +0100 |
---|---|---|
committer | Ulf Hermann <ulf.hermann@qt.io> | 2017-05-05 12:32:04 +0000 |
commit | cb36af6f6702f0f6b027fa0cf5d580d74cb4398f (patch) | |
tree | 672be87a8921f4be292d0967d028c11a55241ca0 /libdwfl | |
parent | 5e738a2deec976ffac6c313327f407d7e4760076 (diff) |
Check for existence of GNU-style strerror_r
If we don't have it, we don't translate system error codes to strings in
dwfl_error.c.
Change-Id: I829616cfba787d778c3273f2042512739df91d81
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
Diffstat (limited to 'libdwfl')
-rw-r--r-- | libdwfl/ChangeLog | 5 | ||||
-rw-r--r-- | libdwfl/dwfl_error.c | 4 |
2 files changed, 9 insertions, 0 deletions
diff --git a/libdwfl/ChangeLog b/libdwfl/ChangeLog index a7e6e30b..26a3599b 100644 --- a/libdwfl/ChangeLog +++ b/libdwfl/ChangeLog @@ -100,6 +100,11 @@ the note name data is the empty string. (dwfl_core_file_attach): Likewise. +2017-02-22 Ulf Hermann <ulf.hermann@qt.io> + + * dwfl_error.c: If we don't have a strerror_r returning a char*, + output a less useful message in case of a system error. + 2017-02-15 Ulf Hermann <ulf.hermann@qt.io> * linux-kernel-modules.c: Include system.h. diff --git a/libdwfl/dwfl_error.c b/libdwfl/dwfl_error.c index 7bcf61cc..aba3cca8 100644 --- a/libdwfl/dwfl_error.c +++ b/libdwfl/dwfl_error.c @@ -154,7 +154,11 @@ dwfl_errmsg (int error) switch (error &~ 0xffff) { case OTHER_ERROR (ERRNO): +#ifdef STRERROR_R_CHAR_P return strerror_r (error & 0xffff, "bad", 0); +#else + return "Unknown error. See errno"; +#endif case OTHER_ERROR (LIBELF): return elf_errmsg (error & 0xffff); case OTHER_ERROR (LIBDW): |