[glib/3v1n0/strerror_r-int-variant-support: 1/2] gbacktrace: Handle case of strerror_r returning an int value
- From: Marco Trevisan <marcotrevi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/3v1n0/strerror_r-int-variant-support: 1/2] gbacktrace: Handle case of strerror_r returning an int value
- Date: Wed, 6 Jul 2022 22:01:54 +0000 (UTC)
commit e3a522cc0da3ee087aa67de4665db4da546b975a
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date: Wed Jul 6 23:45:39 2022 +0200
gbacktrace: Handle case of strerror_r returning an int value
As it's the case in FreeBSD and Mac OS X.
glib/gbacktrace.c | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
diff --git a/glib/gbacktrace.c b/glib/gbacktrace.c
index ae4bdec0c7..9e66df78c4 100644
--- a/glib/gbacktrace.c
+++ b/glib/gbacktrace.c
@@ -323,8 +323,12 @@ stack_trace_sigchld (int signum)
static inline const char *
get_strerror (char *buffer, gsize n)
{
-#ifdef HAVE_STRERROR_R
+#if defined(STRERROR_R_CHAR_P)
return strerror_r (errno, buffer, n);
+#elif defined(HAVE_STRERROR_R)
+ if (strerror_r (errno, buffer, n) == 0)
+ return buffer;
+ return NULL;
#else
const char *error_str = strerror (errno);
if (!error_str)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]