Skip to content

Commit a3c14d6

Browse files
authored
Do not use errno_t as it is not defined on musl (#20037)
1 parent 175afc4 commit a3c14d6

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

main/network.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1090,7 +1090,7 @@ PHPAPI char *php_socket_strerror(long err, char *buf, size_t bufsize)
10901090
char *errstr = strerror_r(err, ebuf, sizeof(ebuf));
10911091
buf = estrdup(errstr);
10921092
# else
1093-
errno_t res = strerror_r(err, ebuf, sizeof(ebuf));
1093+
int res = (int) strerror_r(err, ebuf, sizeof(ebuf));
10941094
if (res == 0) {
10951095
buf = estrdup(ebuf);
10961096
} else {
@@ -1101,7 +1101,7 @@ PHPAPI char *php_socket_strerror(long err, char *buf, size_t bufsize)
11011101
# ifdef STRERROR_R_CHAR_P
11021102
buf = strerror_r(err, buf, bufsize);
11031103
# else
1104-
errno_t res = strerror_r(err, buf, bufsize);
1104+
int res = (int) strerror_r(err, buf, bufsize);
11051105
if (res != 0) {
11061106
strncpy(buf, "Unknown error", bufsize);
11071107
buf[bufsize?(bufsize-1):0] = 0;
@@ -1146,7 +1146,7 @@ PHPAPI zend_string *php_socket_error_str(long err)
11461146
char *errstr = strerror_r(err, ebuf, sizeof(ebuf));
11471147
# else
11481148
const char *errstr;
1149-
errno_t res = strerror_r(err, ebuf, sizeof(ebuf));
1149+
int res = (int) strerror_r(err, ebuf, sizeof(ebuf));
11501150
if (res == 0) {
11511151
errstr = ebuf;
11521152
} else {

0 commit comments

Comments
 (0)