mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-03-29 11:00:02 +01:00
gbacktrace: Handle case of strerror_r returning an int value
As it's the case in FreeBSD and Mac OS X.
This commit is contained in:
parent
c25ad9aa56
commit
640e586251
@ -323,8 +323,13 @@ 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)
|
||||
int ret = strerror_r (errno, buffer, n);
|
||||
if (ret == 0 || ret == EINVAL)
|
||||
return buffer;
|
||||
return NULL;
|
||||
#else
|
||||
const char *error_str = strerror (errno);
|
||||
if (!error_str)
|
||||
|
Loading…
x
Reference in New Issue
Block a user