mirror of
https://github.com/espressif/openthread.git
synced 2026-09-02 23:30:07 +00:00
[posix] do not exit on EINTR in UART (#3643)
This commit is contained in:
committed by
Jonathan Hui
parent
11339835e4
commit
ab12b47182
@@ -272,19 +272,21 @@ void platformUartProcess(void)
|
||||
{
|
||||
rval = write(s_out_fd, s_write_buffer, s_write_length);
|
||||
|
||||
if (rval <= 0)
|
||||
if (rval >= 0)
|
||||
{
|
||||
s_write_buffer += (uint16_t)rval;
|
||||
s_write_length -= (uint16_t)rval;
|
||||
|
||||
if (s_write_length == 0)
|
||||
{
|
||||
otPlatUartSendDone();
|
||||
}
|
||||
}
|
||||
else if (errno != EINTR)
|
||||
{
|
||||
perror("write");
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
s_write_buffer += (uint16_t)rval;
|
||||
s_write_length -= (uint16_t)rval;
|
||||
|
||||
if (s_write_length == 0)
|
||||
{
|
||||
otPlatUartSendDone();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user