From 77e3b997264777317bf4be8ec84f8df04a111737 Mon Sep 17 00:00:00 2001 From: Antony Dovgal Date: Thu, 12 Apr 2007 13:17:14 +0000 Subject: [PATCH] bail out if unicode.semantics is On (stream_select() is unable to cast Unicode streams to FDs) check stream_select() return value correctly and avoid endless loop --- run-tests.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/run-tests.php b/run-tests.php index 56ec387fb7..919bc934f1 100755 --- a/run-tests.php +++ b/run-tests.php @@ -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); -- 2.40.0