mirror of
https://github.com/espressif/openthread.git
synced 2026-08-13 14:17:47 +00:00
[posix] tolerate SIGPIPE under daemon mode (#4994)
Chances are that the ot-ctl client exits between read error check and write. This will lead to a SIGPIPE crash. We can ignore this signal and check the error code instead.
This commit is contained in:
@@ -297,7 +297,12 @@ void platformUartProcess(const fd_set *aReadFdSet, const fd_set *aWriteFdSet, co
|
||||
|
||||
if ((sWriteLength > 0) && (FD_ISSET(fd, aWriteFdSet)))
|
||||
{
|
||||
#if OPENTHREAD_POSIX_CONFIG_DAEMON_ENABLE
|
||||
// Don't die on SIGPIPE
|
||||
rval = send(fd, sWriteBuffer, sWriteLength, MSG_NOSIGNAL);
|
||||
#else
|
||||
rval = write(fd, sWriteBuffer, sWriteLength);
|
||||
#endif
|
||||
|
||||
if (rval < 0)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user