Fixed problems with running processes returns wrong exitcode (-1) on Linux.

This commit is contained in:
Osman Üngür 2011-07-11 09:37:49 -07:00
parent e718a51b59
commit 95ca258a42

View File

@ -174,13 +174,13 @@ class Process
$this->status = proc_get_status($process);
}
proc_close($process);
$exitCode = proc_close($process);
if ($this->status['signaled']) {
throw new \RuntimeException(sprintf('The process stopped because of a "%s" signal.', $this->status['stopsig']));
}
return $this->exitcode = $this->status['exitcode'];
return $this->exitcode = ($this->status["running"] ? $exitCode : $this->status["exitcode"]);
}
/**