[Process] Do not reset stdout/stderr pipes on Interrupted system call

When `stream_select` is called and return false because of an `Interrupted
system call`, pipes are currently reset to an empty array.
As a result, both error-output and output are empty whereas the
exitcode is 0 (successful process).
This commit is contained in:
Romain Neutron 2013-01-03 15:01:40 +01:00
parent 114bbce806
commit fa6fb6fa80
1 changed files with 6 additions and 3 deletions

View File

@ -338,10 +338,13 @@ class Process
$w = null;
$e = null;
$n = @stream_select($r, $w, $e, $this->timeout);
if (false === $n = @stream_select($r, $w, $e, $this->timeout)) {
$lastError = error_get_last();
if (false === $n) {
$this->pipes = array();
// stream_select returns false when the `select` system call is interrupted by an incoming signal
if (isset($lastError['message']) && false === stripos($lastError['message'], 'interrupted system call')) {
$this->pipes = array();
}
continue;
}