mirror of
https://github.com/php/php-src.git
synced 2024-11-27 03:44:07 +08:00
fix: handle the GNU specific version of strerror_r
Close GH-11882
This commit is contained in:
parent
dddd309da4
commit
96885bc04f
3
NEWS
3
NEWS
@ -8,6 +8,9 @@ PHP NEWS
|
||||
. Fixed bug GH-10964 (Improve man page about the built-in server).
|
||||
(Alexandre Daubois)
|
||||
|
||||
- Core:
|
||||
. Fixed strerror_r detection at configuration time. (Kévin Dunglas)
|
||||
|
||||
- DOM:
|
||||
. Fix DOMEntity field getter bugs. (nielsdos)
|
||||
. Fix incorrect attribute existence check in DOMElement::setAttributeNodeNS.
|
||||
|
12
Zend/zend.c
12
Zend/zend.c
@ -1649,9 +1649,15 @@ ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn(int type, const char *
|
||||
|
||||
ZEND_API ZEND_COLD ZEND_NORETURN void zend_strerror_noreturn(int type, int errn, const char *message)
|
||||
{
|
||||
#ifdef HAVE_STR_ERROR_R
|
||||
char buf[1024];
|
||||
strerror_r(errn, buf, sizeof(buf));
|
||||
#ifdef HAVE_STRERROR_R
|
||||
char b[1024];
|
||||
|
||||
# ifdef STRERROR_R_CHAR_P
|
||||
char *buf = strerror_r(errn, b, sizeof(b));
|
||||
# else
|
||||
strerror_r(errn, b, sizeof(b));
|
||||
char *buf = b;
|
||||
# endif
|
||||
#else
|
||||
char *buf = strerror(errn);
|
||||
#endif
|
||||
|
@ -621,9 +621,11 @@ vasprintf \
|
||||
asprintf \
|
||||
nanosleep \
|
||||
memmem \
|
||||
strerror_r \
|
||||
)
|
||||
|
||||
dnl Check for strerror_r, and if its a POSIX-compatible or a GNU specific version.
|
||||
AC_FUNC_STRERROR_R
|
||||
|
||||
AX_FUNC_WHICH_GETHOSTBYNAME_R
|
||||
|
||||
dnl Some systems (like OpenSolaris) do not have nanosleep in libc.
|
||||
|
Loading…
Reference in New Issue
Block a user