mirror of
https://github.com/danog/process.git
synced 2024-12-12 09:09:44 +01:00
Fix exit code reader
This commit is contained in:
parent
a5146213ec
commit
13a71c570d
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user