Skip to content

Commit d083a13

Browse files
committed
Don't continue polling on EINTR
1 parent ba54a46 commit d083a13

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

‎main/streams/xp_socket.c

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -132,18 +132,9 @@ static void php_sock_stream_wait_for_data(php_stream *stream, php_netstream_data
132132
else
133133
ptimeout = &sock->timeout;
134134

135-
while(1) {
136-
retval = php_pollfd_for(sock->socket, PHP_POLLREADABLE, ptimeout);
137-
138-
if (retval == 0)
139-
sock->timeout_event = 1;
140-
141-
if (retval >= 0)
142-
break;
143-
144-
if (php_socket_errno() != EINTR)
145-
break;
146-
}
135+
retval = php_pollfd_for(sock->socket, PHP_POLLREADABLE, ptimeout);
136+
if (retval == 0)
137+
sock->timeout_event = 1;
147138
}
148139

149140
static ssize_t php_sockop_read(php_stream *stream, char *buf, size_t count)

0 commit comments

Comments
 (0)