lbarnaud Tue Nov 4 00:43:06 2008 UTC Added files: (Branch: PHP_5_2) /php-src/ext/standard/tests/streams bug46024.phpt
Modified files: /php-src/ext/standard streamsfuncs.c /php-src NEWS Log: MFH: Fixed bug #46024 (stream_select() doesn't return the correct number) http://cvs.php.net/viewvc.cgi/php-src/ext/standard/streamsfuncs.c?r1=1.58.2.6.2.27&r2=1.58.2.6.2.28&diff_format=u Index: php-src/ext/standard/streamsfuncs.c diff -u php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.27 php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.28 --- php-src/ext/standard/streamsfuncs.c:1.58.2.6.2.27 Thu Oct 30 15:56:23 2008 +++ php-src/ext/standard/streamsfuncs.c Tue Nov 4 00:43:06 2008 @@ -17,7 +17,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: streamsfuncs.c,v 1.58.2.6.2.27 2008/10/30 15:56:23 felipe Exp $ */ +/* $Id: streamsfuncs.c,v 1.58.2.6.2.28 2008/11/04 00:43:06 lbarnaud Exp $ */ #include "php.h" #include "php_globals.h" @@ -782,6 +782,12 @@ retval = stream_array_emulate_read_fd_set(r_array TSRMLS_CC); if (retval > 0) { + if (w_array != NULL) { + zend_hash_clean(Z_ARRVAL_P(w_array)); + } + if (e_array != NULL) { + zend_hash_clean(Z_ARRVAL_P(e_array)); + } RETURN_LONG(retval); } } http://cvs.php.net/viewvc.cgi/php-src/NEWS?r1=1.2027.2.547.2.1300&r2=1.2027.2.547.2.1301&diff_format=u Index: php-src/NEWS diff -u php-src/NEWS:1.2027.2.547.2.1300 php-src/NEWS:1.2027.2.547.2.1301 --- php-src/NEWS:1.2027.2.547.2.1300 Mon Nov 3 23:29:50 2008 +++ php-src/NEWS Tue Nov 4 00:43:06 2008 @@ -20,6 +20,8 @@ circumstances). (Felipe) - Fixed bug #46064 (Exception when creating ReflectionProperty object on dynamicly created property). (Felipe) +- Fixed bug #46024 (stream_select() doesn't return the correct number). + (Arnaud) - Fixed bug #45529 (new DateTimeZone() and date_create()->getTimezone() behave different). (Derick) - Fixed bug #45303 (Opening php:// wrapper in append mode results in a warning). http://cvs.php.net/viewvc.cgi/php-src/ext/standard/tests/streams/bug46024.phpt?view=markup&rev=1.1 Index: php-src/ext/standard/tests/streams/bug46024.phpt +++ php-src/ext/standard/tests/streams/bug46024.phpt --TEST-- Bug #46024 stream_select() doesn't return the correct number --SKIPIF-- <?php if (!getenv('TEST_PHP_EXECUTABLE')) die("TEST_PHP_EXECUTABLE not defined"); ?> --FILE-- <?php $php = getenv('TEST_PHP_EXECUTABLE'); $pipes = array(); $proc = proc_open( "$php -n -i" ,array(0 => array('pipe', 'r'), 1 => array('pipe', 'w')) ,$pipes, dirname(__FILE__), array(), array('binary_pipes' => true) ); var_dump($proc); if (!$proc) { exit(1); } $r = array($pipes[1]); $w = array($pipes[0]); $e = null; $ret = stream_select($r, $w, $e, 1); var_dump($ret === (count($r) + count($w))); fread($pipes[0], 1); $r = array($pipes[1]); $w = array($pipes[0]); $e = null; $ret = stream_select($r, $w, $e, 1); var_dump($ret === (count($r) + count($w))); foreach($pipes as $pipe) { fclose($pipe); } proc_terminate($proc); if (defined('SIGKILL')) { proc_terminate($proc, SIGKILL); } else { proc_terminate($proc); } proc_close($proc); ?> --EXPECTF-- resource(%d) of type (process) bool(true) bool(true) -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php