1
0
mirror of https://github.com/danog/process.git synced 2024-12-03 10:07:46 +01:00

Fix PID reader

This commit is contained in:
Niklas Keller 2017-09-17 22:08:49 +02:00
parent 13a71c570d
commit 8aabd17000

View File

@ -200,15 +200,15 @@ final class SocketConnector {
}
public function onReadableChildPid($watcher, $socket, Handle $handle) {
Loop::cancel($watcher);
Loop::cancel($handle->connectTimeoutWatcher);
$data = \fread($socket, 5);
if ($data === false || $data === '') {
return;
}
Loop::cancel($watcher);
Loop::cancel($handle->connectTimeoutWatcher);
if (\strlen($data) !== 5) {
$this->failHandleStart(
$handle, 'Failed to read PID from wrapper: Received %d of 5 expected bytes', \strlen($data)