[Process] Close pipes before calling proc_close to avoid deadlocks as advised on the proc_close php.net documentation
This commit is contained in:
parent
f4227b5f82
commit
e82a05d3e7
@ -503,6 +503,12 @@ class Process
|
|||||||
$time += 1000;
|
$time += 1000;
|
||||||
usleep(1000);
|
usleep(1000);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
foreach ($this->pipes as $pipe) {
|
||||||
|
fclose($pipe);
|
||||||
|
}
|
||||||
|
$this->pipes = array();
|
||||||
|
|
||||||
$exitcode = proc_close($this->process);
|
$exitcode = proc_close($this->process);
|
||||||
$this->exitcode = -1 === $this->processInformation['exitcode'] ? $exitcode : $this->processInformation['exitcode'];
|
$this->exitcode = -1 === $this->processInformation['exitcode'] ? $exitcode : $this->processInformation['exitcode'];
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user