1
0
mirror of https://github.com/danog/process.git synced 2024-12-12 09:09:44 +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) { public function onReadableChildPid($watcher, $socket, Handle $handle) {
Loop::cancel($watcher);
Loop::cancel($handle->connectTimeoutWatcher);
$data = \fread($socket, 5); $data = \fread($socket, 5);
if ($data === false || $data === '') { if ($data === false || $data === '') {
return; return;
} }
Loop::cancel($watcher);
Loop::cancel($handle->connectTimeoutWatcher);
if (\strlen($data) !== 5) { if (\strlen($data) !== 5) {
$this->failHandleStart( $this->failHandleStart(
$handle, 'Failed to read PID from wrapper: Received %d of 5 expected bytes', \strlen($data) $handle, 'Failed to read PID from wrapper: Received %d of 5 expected bytes', \strlen($data)