]> granicus.if.org Git - php/commitdiff
return success only if succeeded casting at least one stream to fd
authorAntony Dovgal <tony2001@php.net>
Thu, 12 Apr 2007 13:15:17 +0000 (13:15 +0000)
committerAntony Dovgal <tony2001@php.net>
Thu, 12 Apr 2007 13:15:17 +0000 (13:15 +0000)
ext/standard/streamsfuncs.c

index 85c6f35b35824d2c1e6ad878432aa1ec6228d16f..327806da640a49edc399a18c7967614a6c7088d4 100644 (file)
@@ -620,6 +620,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;
@@ -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) {
                                *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)