wez             Sat Apr 13 07:13:02 2002 EDT

  Modified files:              
    /phpdoc/en/functions        exec.xml 
  Log:
  amend proc_open example
  
Index: phpdoc/en/functions/exec.xml
diff -u phpdoc/en/functions/exec.xml:1.28 phpdoc/en/functions/exec.xml:1.29
--- phpdoc/en/functions/exec.xml:1.28   Fri Apr 12 22:00:33 2002
+++ phpdoc/en/functions/exec.xml        Sat Apr 13 07:13:02 2002
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
-<!-- $Revision: 1.28 $ -->
+<!-- $Revision: 1.29 $ -->
  <reference id="ref.exec">
   <title>Program Execution functions</title>
   <titleabbrev>Program Execution</titleabbrev>
@@ -282,11 +282,14 @@
     // Any error output will be appended to /tmp/error-output.txt
 
     fwrite($pipes[0], "<?php echo \"Hello World!\"; ?>");
+    fclose($pipes[0]);
 
     while(!feof($pipes[1])) {
         echo fgets($pipes[1], 1024);
     }
-
+    fclose($pipes[1]);
+    // It is important that you close any pipes before calling
+    // proc_close in order to avoid a deadlock
     $return_value = proc_close($process);
 
     echo "command returned $return_value\n";


Reply via email to