Fix detection and usage of strerror_r()

autoconf provides a macro for this situation, which saves us having to
manually work out whether strerror_r() returns a char* or an int.

https://bugzilla.gnome.org/show_bug.cgi?id=784000
This commit is contained in:
Igor Pashev
2017-06-20 13:38:00 +00:00
committed by Philip Withnall
parent bb50b70713
commit c8e268bbce
2 changed files with 4 additions and 3 deletions

View File

@@ -1277,10 +1277,10 @@ g_strerror (gint errnum)
msg = buf;
#elif defined(HAVE_STRERROR_R)
/* Match the condition in strerror_r(3) for glibc */
# if defined(__GLIBC__) && !((_POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE >= 600) && ! _GNU_SOURCE)
# if defined(STRERROR_R_CHAR_P)
msg = strerror_r (errnum, buf, sizeof (buf));
# else
strerror_r (errnum, buf, sizeof (buf));
(void) strerror_r (errnum, buf, sizeof (buf));
msg = buf;
# endif /* HAVE_STRERROR_R */
#else