* src/ls.c (print_dir): readdir() on FreeBSD 14 was
seen to pass ENOENT through. ENOENT in this context
means "Directory unlinked but still open".
Reported by Bruno Haible with tests/ls/removed-directory.sh
and when readdir simply finds that there are no more entries. */
errno = 0;
next = readdir (dirp);
+ /* Some readdir()s do not absorb ENOENT (dir deleted but open). */
+ if (errno == ENOENT)
+ errno = 0;
if (next)
{
if (! file_ignored (next->d_name))