michallenc opened a new pull request, #19197: URL: https://github.com/apache/nuttx/pull/19197
## Summary The current implementation exits `syslog_write_foreach` function if write to one channel fails, causing other channels not being written and returning negated errno. libc syslog functions then stay in an infinite loop, because error is returned and the same bytes are still passed to `syslograwstream_flush` and `syslog_write_foreach`. The channel write may fail for many reasons - disconnected USB if CDC ACM syslog is enabled, lost networking if telnet syslog is enabled, error on NOR flash etc. This shouldn't lead to an ininite loop in the code though. The solution ensures all channels in syslog_write_foreach are tried, therefore the user get the output to the working channels even if the first one is broken. It also updates `syslograwstream_addchar` and `syslograwstream_addstring` to skip the bytes if all channels fails. This ensures syslog call won't result in an infinite loop, but the user may lost the debugging output. ## Impact Bug fix, no behavior changes except the debugging output is lost if all channels fail. ## Testing The faulty behavior is easily reproducible by enabling the syslog output on CDC ACM device and disconnecting USB - it leads to an infinite loop of syslog outputs on standard console (the other syslog channel). Closes [19173](https://github.com/apache/nuttx/issues/19173) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
