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:
parent
13a71c570d
commit
8aabd17000
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user