Forráskód Böngészése

[Console] fixed Process exit code

To get the proper status for the Process, it needs to be terminated.
Sometimes, this is not the case when we call proc_get_status, so this
patch waits up to 1 sec to get the right information.
Fabien Potencier 14 éve
szülő
commit
100a8dc105
1 módosított fájl, 7 hozzáadás és 0 törlés
  1. 7 0
      src/Symfony/Component/Process/Process.php

+ 7 - 0
src/Symfony/Component/Process/Process.php

@@ -174,6 +174,13 @@ class Process
 
         $this->status = proc_get_status($process);
 
+        $time = 0;
+        while (1 == $this->status['running'] && $time < 1000000) {
+            $time += 1000;
+            usleep(1000);
+            $this->status = proc_get_status($process);
+        }
+
         proc_close($process);
 
         if ($this->status['signaled']) {