syslog: avoid an infinite loop if one channel fails 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. Co-authored-by: Martin Krasula <mkrasula@elektroline.cz> Signed-off-by: Michal Lenc <michallenc@seznam.cz>
Apache NuttX is a real-time operating system (RTOS) with an emphasis on standards compliance and small footprint. Scalable from 8-bit to 64-bit microcontroller environments, the primary governing standards in NuttX are POSIX and ANSI standards. Additional standard APIs from Unix and other common RTOSs (such as VxWorks) are adopted for functionality not available under these standards, or for functionality that is not appropriate for deeply-embedded environments (such as fork()).
For brevity, many parts of the documentation will refer to Apache NuttX as simply NuttX.
First time on NuttX? Read the Getting Started guide! If you don't have a board available, NuttX has its own simulator that you can run on terminal.
You can find the current NuttX documentation on the Documentation Page.
Alternatively, you can build the documentation yourself by following the Documentation Build Instructions.
The old NuttX documentation is still available in the Apache wiki.
NuttX supports a wide variety of platforms. See the full list on the Supported Platforms page.
If you wish to contribute to the NuttX project, read the Contributing guidelines for information on Git usage, coding standard, workflow and the NuttX principles.
The code in this repository is under either the Apache 2 license, or a license compatible with the Apache 2 license. See the License Page for more information.