]> granicus.if.org Git - php/commitdiff
MFH
authorJani Taskinen <jani@php.net>
Wed, 10 Oct 2007 12:58:41 +0000 (12:58 +0000)
committerJani Taskinen <jani@php.net>
Wed, 10 Oct 2007 12:58:41 +0000 (12:58 +0000)
ext/standard/streamsfuncs.c

index 33309668d230449d49e344636125b9068ea1d97b..501405818077e88260678a1b58d36e944cfccfb9 100644 (file)
@@ -574,6 +574,7 @@ static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, php_socket_t
        zval **elem;
        php_stream *stream;
        php_socket_t this_fd;
+       int cnt = 0;
 
        if (Z_TYPE_P(stream_array) != IS_ARRAY) {
                return 0;
@@ -598,9 +599,10 @@ static int stream_array_to_fd_set(zval *stream_array, fd_set *fds, php_socket_t
                        if (this_fd > *max_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)
@@ -608,7 +610,8 @@ static int stream_array_from_fd_set(zval *stream_array, fd_set *fds TSRMLS_DC)
        zval **elem, **dest_elem;
        php_stream *stream;
        HashTable *new_hash;
-       php_socket_t this_fd, ret = 0;
+       php_socket_t this_fd;
+       int ret = 0;
 
        if (Z_TYPE_P(stream_array) != IS_ARRAY) {
                return 0;