summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2004-09-28 09:30:20 +0000
committerWez Furlong <wez@php.net>2004-09-28 09:30:20 +0000
commit797cda2555dca1ae25d043eefc96f52d8f232bb8 (patch)
treec0848f60a475aa9165298f76d03a4ce1589c6c43
parenta540196a410cf1d9976c05cbdf0aaea87fe61f53 (diff)
downloadphp-git-797cda2555dca1ae25d043eefc96f52d8f232bb8.tar.gz
MFH: select usage fix
-rw-r--r--ext/sockets/sockets.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/ext/sockets/sockets.c b/ext/sockets/sockets.c
index 8f2a329c35..c9ac0b5dc8 100644
--- a/ext/sockets/sockets.c
+++ b/ext/sockets/sockets.c
@@ -533,7 +533,7 @@ static int php_sock_array_to_fd_set(zval *sock_array, fd_set *fds, PHP_SOCKET *m
php_sock = (php_socket*) zend_fetch_resource(element TSRMLS_CC, -1, le_socket_name, NULL, 1, le_socket);
if (!php_sock) continue; /* If element is not a resource, skip it */
- FD_SET(php_sock->bsd_socket, fds);
+ PHP_SAFE_FD_SET(php_sock->bsd_socket, fds);
if (php_sock->bsd_socket > *max_fd) {
*max_fd = php_sock->bsd_socket;
}
@@ -560,7 +560,7 @@ static int php_sock_array_from_fd_set(zval *sock_array, fd_set *fds TSRMLS_DC)
php_sock = (php_socket*) zend_fetch_resource(element TSRMLS_CC, -1, le_socket_name, NULL, 1, le_socket);
if (!php_sock) continue; /* If element is not a resource, skip it */
- if (FD_ISSET(php_sock->bsd_socket, fds)) {
+ if (PHP_SAFE_FD_ISSET(php_sock->bsd_socket, fds)) {
/* Add fd to new array */
zend_hash_next_index_insert(new_hash, (void *)element, sizeof(zval *), (void **)&dest_element);
if (dest_element) zval_add_ref(dest_element);
@@ -605,6 +605,8 @@ PHP_FUNCTION(socket_select)
RETURN_FALSE;
}
+ PHP_SAFE_MAX_FD(max_fd, 0); /* someone needs to make this look more like stream_socket_select */
+
/* If seconds is not set to null, build the timeval, else we wait indefinitely */
if (sec != NULL) {
zval tmp;