mirror of
https://github.com/php/php-src.git
synced 2025-08-20 09:24:05 +02:00
return success only if succeeded casting at least one stream to fd
This commit is contained in:
parent
1efa2ab3fc
commit
63d2c1f093
1 changed files with 3 additions and 1 deletions
|
@ -620,6 +620,7 @@ static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, php_socket_t
|
||||||
zval **elem;
|
zval **elem;
|
||||||
php_stream *stream;
|
php_stream *stream;
|
||||||
php_socket_t this_fd;
|
php_socket_t this_fd;
|
||||||
|
int cnt = 0;
|
||||||
|
|
||||||
if (Z_TYPE_P(stream_array) != IS_ARRAY) {
|
if (Z_TYPE_P(stream_array) != IS_ARRAY) {
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -644,9 +645,10 @@ static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, php_socket_t
|
||||||
if (this_fd > *max_fd) {
|
if (this_fd > *max_fd) {
|
||||||
*max_fd = this_fd;
|
*max_fd = this_fd;
|
||||||
}
|
}
|
||||||
|
cnt++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return 1;
|
return cnt ? 1 : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC)
|
static int stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue