mirror of
https://github.com/espressif/openthread.git
synced 2026-08-02 09:07:47 +00:00
[posix] handle RCP disconnection (EOF from read()) (#13006)
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
parent
611c62126a
commit
d27c618ccb
@@ -201,7 +201,11 @@ void HdlcInterface::Read(void)
|
||||
{
|
||||
Decode(buffer, static_cast<uint16_t>(rval));
|
||||
}
|
||||
else if ((rval < 0) && (errno != EAGAIN) && (errno != EINTR))
|
||||
else if (rval == 0)
|
||||
{
|
||||
DieNowWithMessage("RCP device disconnected (EOF)", OT_EXIT_FAILURE);
|
||||
}
|
||||
else if ((errno != EAGAIN) && (errno != EWOULDBLOCK) && (errno != EINTR))
|
||||
{
|
||||
DieNow(OT_EXIT_ERROR_ERRNO);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user