mirror of
https://github.com/danog/process.git
synced 2024-12-04 18:48:13 +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) {
|
public function onReadableExitCode($watcher, $socket, Handle $handle) {
|
||||||
$handle->exitCodeWatcher = null;
|
|
||||||
Loop::cancel($watcher);
|
|
||||||
|
|
||||||
$data = \fread($socket, 5);
|
$data = \fread($socket, 5);
|
||||||
|
|
||||||
if ($data === false || $data === '') {
|
if ($data === false || $data === '') {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$handle->exitCodeWatcher = null;
|
||||||
|
Loop::cancel($watcher);
|
||||||
|
|
||||||
if (\strlen($data) !== 5) {
|
if (\strlen($data) !== 5) {
|
||||||
$handle->status = ProcessStatus::ENDED;
|
$handle->status = ProcessStatus::ENDED;
|
||||||
$handle->joinDeferred->fail(new ProcessException(
|
$handle->joinDeferred->fail(new ProcessException(
|
||||||
|
Loading…
Reference in New Issue
Block a user