]> granicus.if.org Git - php/commitdiff
Reverted part of Steph's patch (stdin stream must be closed to make script finish)
authorDmitry Stogov <dmitry@php.net>
Tue, 24 Jun 2008 06:05:29 +0000 (06:05 +0000)
committerDmitry Stogov <dmitry@php.net>
Tue, 24 Jun 2008 06:05:29 +0000 (06:05 +0000)
run-tests.php

index 0ef03f7e971c6da42392132760c4185dd12aed59..f5cbfb05c0d0cd8b9a3eb871b909cd786f5ee0e6 100755 (executable)
@@ -929,6 +929,7 @@ function system_with_timeout($commandline, $env = null, $stdin = null)
        if (is_string($stdin)) {
                fwrite($pipes[0], $stdin);
        }
+       fclose($pipes[0]);
 
        $timeout = $leak_check ? 300 : (isset($env['TEST_TIMEOUT']) ? $env['TEST_TIMEOUT'] : 60);
 
@@ -942,7 +943,6 @@ function system_with_timeout($commandline, $env = null, $stdin = null)
                if ($n === 0) {
                        /* timed out */
                        $data .= "\n ** ERROR: process timed out **\n";
-                       fclose($pipes[0]);
                        proc_terminate($proc);
                        return $data;
                } else if ($n > 0) {
@@ -958,7 +958,6 @@ function system_with_timeout($commandline, $env = null, $stdin = null)
        if ($stat['signaled']) {
                $data .= "\nTermsig=".$stat['stopsig'];
        }
-       fclose($pipes[0]);
        $code = proc_close($proc);
        return $data;
 }