nuttx/libs
yushuailong 7e67d2d906 libs/libc/dirent: preserve errno on readdir() end-of-directory
readdir() returned NULL at end-of-directory without ensuring errno was
clean.  POSIX requires errno to be unchanged at EOF, but the underlying
read() path may leave a stale errno value.  Callers that follow the
POSIX idiom (set errno to 0 before the call, test it after a NULL
return), such as readdir_r() and scandir(), then misread this as a
readdir() failure.

Save errno on entry and restore it on the end-of-directory return so
that EOF no longer reports a spurious error, while genuine errors
(read() returning a negative value) still propagate.

Signed-off-by: yushuailong <yyyusl@qq.com>
2026-06-02 23:34:25 +08:00
..
libbuiltin fix(compiler-rt): avoid duplicate builtins dir on sim 2026-05-13 10:01:26 -03:00
libc libs/libc/dirent: preserve errno on readdir() end-of-directory 2026-06-02 23:34:25 +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