mirror of
https://github.com/php/php-src.git
synced 2024-11-26 03:16:33 +08:00
MFH:
- Added check for EWOULDBLOCK - Using EWOULDBLOCK instead of EAGAIN by portability issues (Related to #46917)
This commit is contained in:
parent
c7ef31aefb
commit
7c989115c2
@ -40,6 +40,10 @@
|
||||
# define ftruncate(a, b) chsize(a, b)
|
||||
#endif /* defined(PHP_WIN32) */
|
||||
|
||||
#ifndef EWOULDBLOCK
|
||||
# define EWOULDBLOCK EAGAIN
|
||||
#endif
|
||||
|
||||
#ifdef PHP_WIN32
|
||||
#define php_socket_errno() WSAGetLastError()
|
||||
#else
|
||||
|
@ -281,7 +281,7 @@ static int php_sockop_set_option(php_stream *stream, int option, int value, void
|
||||
if (sock->socket == -1) {
|
||||
alive = 0;
|
||||
} else if (php_pollfd_for(sock->socket, PHP_POLLREADABLE|POLLPRI, &tv) > 0) {
|
||||
if (0 == recv(sock->socket, &buf, sizeof(buf), MSG_PEEK) && php_socket_errno() != EAGAIN) {
|
||||
if (0 == recv(sock->socket, &buf, sizeof(buf), MSG_PEEK) && php_socket_errno() != EWOULDBLOCK) {
|
||||
alive = 0;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user