[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
This commit is contained in:
Chris Smith 2012-07-18 18:20:44 +01:00
parent cb82287416
commit 310c458936
1 changed files with 2 additions and 2 deletions

View File

@ -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) {