]> granicus.if.org Git - php/commitdiff
MFH
authorHartmut Holzgraefe <hholzgra@php.net>
Tue, 15 Jul 2003 17:05:03 +0000 (17:05 +0000)
committerHartmut Holzgraefe <hholzgra@php.net>
Tue, 15 Jul 2003 17:05:03 +0000 (17:05 +0000)
ext/standard/tests/file/proc_open01.phpt

index ab41a358196e039e4fea777f8aa0403fea5a11cd..d1e066e092de9b746f4334c76d971c8a1c47a5b7 100644 (file)
@@ -4,8 +4,12 @@ proc_open() regression test 1 (proc_open() leak)
 <?php
 $pipes = array(1, 2, 3);
 $orig_pipes = $pipes;
+$php = getenv('TEST_PHP_EXECUTABLE'); 
+if ($php === false) {
+       die("no php executable defined");
+} 
 $proc = proc_open(
-       $_ENV['TEST_PHP_EXECUTABLE'],
+       $php,
        array(0 => array('pipe', 'r'), 1 => array('pipe', 'w')),
        $pipes
 );
@@ -19,7 +23,12 @@ fwrite($pipes[0], $test_string);
 fflush($pipes[0]);
 fclose($pipes[0]);
 $cnt = '';
+$n=0;
 for ($left = strlen($test_string); $left > 0;) { 
+       if (++$n >1000) {
+         print "terminated after 1000 iterations\n";
+         break;
+  }
        $read_fds = array($pipes[1]);
        $retval = stream_select($read_fds, $write_fds = NULL, $exp_fds = NULL, 1);
        if ($retval === false) {