mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00:00
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> |
||
|---|---|---|
| .. | ||
| CMakeLists.txt | ||
| lib_alphasort.c | ||
| lib_closedir.c | ||
| lib_dirfd.c | ||
| lib_fdopendir.c | ||
| lib_ftw.c | ||
| lib_nftw.c | ||
| lib_opendir.c | ||
| lib_readdir.c | ||
| lib_readdirr.c | ||
| lib_rewinddir.c | ||
| lib_scandir.c | ||
| lib_seekdir.c | ||
| lib_telldir.c | ||
| lib_versionsort.c | ||
| Make.defs | ||