From 310c4589365df2c2ae875fa687fd56e8a5d7e025 Mon Sep 17 00:00:00 2001 From: Chris Smith Date: Wed, 18 Jul 2012 18:20:44 +0100 Subject: [PATCH] [Process] Fixed a problem on RHEL5 where the exit code was incorrect RHEL5 will intermittently result in an exit code of -1 [1] due to proc_get_status() being called after the process has completed but outside of updateStatus() which saves the exit code. [1]: https://github.com/composer/composer/issues/876 --- src/Symfony/Component/Process/Process.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Symfony/Component/Process/Process.php b/src/Symfony/Component/Process/Process.php index 60f265024c..6df07a1075 100644 --- a/src/Symfony/Component/Process/Process.php +++ b/src/Symfony/Component/Process/Process.php @@ -290,7 +290,7 @@ class Process } } - $this->processInformation = proc_get_status($this->process); + $this->updateStatus(); } /** @@ -308,7 +308,7 @@ class Process */ public function wait($callback = null) { - $this->processInformation = proc_get_status($this->process); + $this->updateStatus(); $callback = $this->buildCallback($callback); while ($this->pipes || (defined('PHP_WINDOWS_VERSION_BUILD') && $this->fileHandles)) { if (defined('PHP_WINDOWS_VERSION_BUILD') && $this->fileHandles) {