[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:
parent
114bbce806
commit
fa6fb6fa80
@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user