1
0
mirror of https://github.com/danog/process.git synced 2024-12-04 02:27:49 +01:00

Fix exit code reader

This commit is contained in:
Niklas Keller 2017-09-17 22:07:53 +02:00
parent a5146213ec
commit 13a71c570d

View File

@ -240,15 +240,15 @@ final class SocketConnector {
}
public function onReadableExitCode($watcher, $socket, Handle $handle) {
$handle->exitCodeWatcher = null;
Loop::cancel($watcher);
$data = \fread($socket, 5);
if ($data === false || $data === '') {
return;
}
$handle->exitCodeWatcher = null;
Loop::cancel($watcher);
if (\strlen($data) !== 5) {
$handle->status = ProcessStatus::ENDED;
$handle->joinDeferred->fail(new ProcessException(