--- glib2.0-2.50.3.orig/configure.ac
+++ glib2.0-2.50.3/configure.ac
@@ -528,7 +528,8 @@ AM_CONDITIONAL(OS_WIN32_AND_DLL_COMPILAT
 # Checks for library functions.
 AC_FUNC_ALLOCA
 AC_CHECK_FUNCS(mmap posix_memalign memalign valloc fsync pipe2 issetugid)
-AC_CHECK_FUNCS(timegm gmtime_r strerror_r)
+AC_CHECK_FUNCS(timegm gmtime_r)
+AC_FUNC_STRERROR_R()
 
 AC_CACHE_CHECK([for __libc_enable_secure], glib_cv_have_libc_enable_secure,
   [AC_TRY_LINK([#include <unistd.h>
--- glib2.0-2.50.3.orig/glib/gstrfuncs.c
+++ glib2.0-2.50.3/glib/gstrfuncs.c
@@ -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
