projects
/
mono.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
d605f45
)
[runtime] Use the AC_FUNC_STRERROR_R() autoconf macro to distinguish between the...
author
Zoltan Varga
<vargaz@gmail.com>
Sun, 27 Aug 2017 07:35:50 +0000
(
03:35
-0400)
committer
GitHub
<noreply@github.com>
Sun, 27 Aug 2017 07:35:50 +0000
(
03:35
-0400)
configure.ac
patch
|
blob
|
history
mono/eglib/gstr.c
patch
|
blob
|
history
diff --git
a/configure.ac
b/configure.ac
index 6ef80db60cbbea8a41de276d7977aa004226f0af..ba174a27c1afea4d0f9a898c4e9fc80df8576b39 100644
(file)
--- a/
configure.ac
+++ b/
configure.ac
@@
-1502,6
+1502,8
@@
if test x$host_win32 = xno; then
AC_CHECK_FUNCS(getpwuid_r)
fi
AC_CHECK_FUNCS(getpwuid_r)
fi
+ AC_FUNC_STRERROR_R()
+
dnl ****************************************************************
dnl *** Check for sched_setaffinity from glibc versions before ***
dnl *** 2.3.4. The older versions of the function only take 2 ***
dnl ****************************************************************
dnl *** Check for sched_setaffinity from glibc versions before ***
dnl *** 2.3.4. The older versions of the function only take 2 ***
diff --git
a/mono/eglib/gstr.c
b/mono/eglib/gstr.c
index cd2fda3c2a115f0fe3a04526d31719d90e0e8e84..e8a76e429cccd7ab887be324e7aa855ab3ef0eae 100644
(file)
--- a/
mono/eglib/gstr.c
+++ b/
mono/eglib/gstr.c
@@
-38,16
+38,6
@@
#include <errno.h>
#include <errno.h>
-/*
- * Linux knows two different versions of strerror_r () that can only be distinguished
- * by using feature test macros. Please check the man pages for more details.
- */
-#if defined (_POSIX_C_SOURCE) && defined (_GNU_SOURCE)
-#if (_POSIX_C_SOURCE >= 200112L) && !_GNU_SOURCE
-#define USE_STRERROR_R_XSI
-#endif
-#endif
-
/*
* g_strndup and g_vasprintf need to allocate memory with g_malloc if
* ENABLE_OVERRIDABLE_ALLOCATORS is defined so that it can be safely freed with g_free
/*
* g_strndup and g_vasprintf need to allocate memory with g_malloc if
* ENABLE_OVERRIDABLE_ALLOCATORS is defined so that it can be safely freed with g_free
@@
-244,7
+234,7
@@
g_strerror (gint errnum)
size_t buff_len = sizeof (tmp_buff);
buff [0] = 0;
size_t buff_len = sizeof (tmp_buff);
buff [0] = 0;
-#if
def USE_STRERROR_R_XSI
+#if
ndef STRERROR_R_CHAR_P
int r;
while ((r = strerror_r (errnum, buff, buff_len - 1))) {
if (r != ERANGE) {
int r;
while ((r = strerror_r (errnum, buff, buff_len - 1))) {
if (r != ERANGE) {
@@
-262,11
+252,11
@@
g_strerror (gint errnum)
error_messages [errnum] = g_strdup (buff);
if (buff != tmp_buff)
g_free (buff);
error_messages [errnum] = g_strdup (buff);
if (buff != tmp_buff)
g_free (buff);
-#else /*
USE_STRERROR_R_XSI
*/
+#else /*
STRERROR_R_CHAR_P
*/
buff = strerror_r (errnum, buff, buff_len);
if (!error_messages [errnum])
error_messages [errnum] = g_strdup (buff);
buff = strerror_r (errnum, buff, buff_len);
if (!error_messages [errnum])
error_messages [errnum] = g_strdup (buff);
-#endif /*
USE_STRERROR_R_XSI
*/
+#endif /*
STRERROR_R_CHAR_P
*/
#else /* HAVE_STRERROR_R */
if (!error_messages [errnum])
#else /* HAVE_STRERROR_R */
if (!error_messages [errnum])