eina: fix use of strerror_r()

So, first, the wrong strerror_r() was detected on
Mac OS X. Instead of using a complex set of macros
to try to detect which strerror_r() to use, when
it is defined, let the autotools handle that clerverness
for us.
This commit is contained in:
Jean Guyomarc'h 2016-08-22 14:06:47 +02:00 committed by Jean Guyomarc'h
parent 4285fc1dda
commit 26a26f2304
2 changed files with 8 additions and 6 deletions

View File

@ -650,6 +650,7 @@ pause \
AC_FUNC_ALLOCA
AC_FUNC_MMAP
AC_FUNC_STRERROR_R
EFL_CHECK_FUNCS([EFLALL], [fnmatch gettimeofday dirfd fcntl sched_getcpu])

View File

@ -312,16 +312,17 @@ eina_error_msg_get(Eina_Error error)
if (!msg)
{
char buf[256] = "";
const char *str;
const char *str = NULL;
#if (_POSIX_C_SOURCE >= 200112L) && ! _GNU_SOURCE
#ifdef HAVE_STRERROR_R
# ifndef STRERROR_R_CHAR_P
if (strerror_r(error, buf, sizeof(buf)) == 0) /* XSI */
str = buf;
else
str = NULL;
#else
# else /* STRERROR_R_CHAR_P */
str = strerror_r(error, buf, sizeof(buf)); /* GNU */
#endif
# endif /* ! STRERROR_R_CHAR_P */
#endif /* HAVE_STRERROR_R */
if (!str)
EINA_SAFETY_ERROR("strerror_r() failed");
else