nuttx/libs
Michal Lenc 1685e8ff7b 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>
2026-06-23 22:45:01 +08:00
..
libbuiltin fix(compiler-rt): avoid duplicate builtins dir on sim 2026-05-13 10:01:26 -03:00
libc syslog: avoid an infinite loop if one channel fails 2026-06-23 22:45:01 +08:00
libdsp Makefile: Remove make depend files by make distclean 2026-02-16 16:27:57 +01:00
libm !compiler: drop CONFIG_HAVE_LONG_LONG and require long long support 2026-05-19 16:21:28 +08:00
libnx include/debug.h: Move to include/nuttx/debug.h 2026-04-07 07:50:06 -03:00
libxx libs\libxx: Fix Make style 2026-03-23 18:16:46 -04:00
CMakeLists.txt libs: migrate to SPDX identifier 2024-10-01 12:25:52 +08:00