Skip to content

Commit e9e5b4c

Browse files
committed
Merge branch 'PHP-8.1' into PHP-8.2
2 parents b80ded8 + 96885bc commit e9e5b4c

File tree

3 files changed

+15
-4
lines changed

3 files changed

+15
-4
lines changed

NEWS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ PHP NEWS
88
. Fixed bug GH-10964 (Improve man page about the built-in server).
99
(Alexandre Daubois)
1010

11+
- Core:
12+
. Fixed strerror_r detection at configuration time. (Kévin Dunglas)
13+
1114
- DOM:
1215
. Fix DOMEntity field getter bugs. (nielsdos)
1316
. Fix incorrect attribute existence check in DOMElement::setAttributeNodeNS.

Zend/zend.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1630,9 +1630,15 @@ ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn(int type, const char *
16301630

16311631
ZEND_API ZEND_COLD ZEND_NORETURN void zend_strerror_noreturn(int type, int errn, const char *message)
16321632
{
1633-
#ifdef HAVE_STR_ERROR_R
1634-
char buf[1024];
1635-
strerror_r(errn, buf, sizeof(buf));
1633+
#ifdef HAVE_STRERROR_R
1634+
char b[1024];
1635+
1636+
# ifdef STRERROR_R_CHAR_P
1637+
char *buf = strerror_r(errn, b, sizeof(b));
1638+
# else
1639+
strerror_r(errn, b, sizeof(b));
1640+
char *buf = b;
1641+
# endif
16361642
#else
16371643
char *buf = strerror(errn);
16381644
#endif

configure.ac

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -633,9 +633,11 @@ asprintf \
633633
nanosleep \
634634
memmem \
635635
memrchr \
636-
strerror_r \
637636
)
638637

638+
dnl Check for strerror_r, and if its a POSIX-compatible or a GNU specific version.
639+
AC_FUNC_STRERROR_R
640+
639641
AX_FUNC_WHICH_GETHOSTBYNAME_R
640642

641643
dnl Some systems (like OpenSolaris) do not have nanosleep in libc.

0 commit comments

Comments
 (0)