]> granicus.if.org Git - php/commitdiff
bail out if unicode.semantics is On (stream_select() is unable to cast Unicode stream...
authorAntony Dovgal <tony2001@php.net>
Thu, 12 Apr 2007 13:17:14 +0000 (13:17 +0000)
committerAntony Dovgal <tony2001@php.net>
Thu, 12 Apr 2007 13:17:14 +0000 (13:17 +0000)
check stream_select() return value correctly and avoid endless loop

run-tests.php

index 56ec387fb76ed59eed43fe537208d5f7905ef0bd..919bc934f16c1f9bb46fbdf4aa663b909f4b8714 100755 (executable)
@@ -82,6 +82,10 @@ if (ob_get_level()) echo "Not all buffers were deleted.\n";
 error_reporting(E_ALL);
 ini_set('magic_quotes_runtime',0); // this would break tests by modifying EXPECT sections
 
+if (ini_get("unicode.semantics")) {
+       error("It is currently not possible to use run-tests.php with unicode.semantics=On. Please turn it Off and re-run the tests.");
+}
+
 $environment = isset($_ENV) ? $_ENV : array();
 
 // Don't ever guess at the PHP executable location.
@@ -869,7 +873,9 @@ function system_with_timeout($commandline, $env = null, $stdin = null)
                $e = null;
                $n = @stream_select($r, $w, $e, $leak_check ? 300 : 60);
 
-               if ($n === 0) {
+               if ($n === false) {
+                       break;
+               } else if ($n === 0) {
                        /* timed out */
                        $data .= "\n ** ERROR: process timed out **\n";
                        proc_terminate($proc);