Skip to content

Commit f7e7b19

Browse files
committed
handle GNU specific versions of strerror_r()
1 parent c03ec39 commit f7e7b19

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

Zend/zend.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1650,8 +1650,13 @@ ZEND_API ZEND_COLD ZEND_NORETURN void zend_error_noreturn(int type, const char *
16501650
ZEND_API ZEND_COLD ZEND_NORETURN void zend_strerror_noreturn(int type, int errn, const char *message)
16511651
{
16521652
#ifdef HAVE_STRERROR_R
1653+
# if (_POSIX_C_SOURCE >= 200112L) && ! _GNU_SOURCE
16531654
char buf[1024];
16541655
strerror_r(errn, buf, sizeof(buf));
1656+
# else
1657+
char b[1024];
1658+
char *buf = strerror_r(errn, b, sizeof(b));
1659+
# endif
16551660
#else
16561661
char *buf = strerror(errn);
16571662
#endif

0 commit comments

Comments
 (0)