Skip to content
This repository was archived by the owner on Nov 11, 2024. It is now read-only.

Commit b7c4d38

Browse files
committed
Don't set errno at the end of a directory if no error occurred
In _FAT_dirnext, which implements a function similar to readdir, don't set errno to ENOENT, because reaching the end of a directory is not an error. This conforms to POSIX readdir and is consistent with _FAT_read not setting errno when reaching EOF.
1 parent 3fde6ce commit b7c4d38

1 file changed

Lines changed: 0 additions & 1 deletion

File tree

source/fatdir.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,6 @@ int _FAT_dirnext_r (struct _reent *r, DIR_ITER *dirState, char *filename, struct
588588
// Make sure there is another file to report on
589589
if (! state->validEntry) {
590590
_FAT_unlock(&state->partition->lock);
591-
r->_errno = ENOENT;
592591
return -1;
593592
}
594593

0 commit comments

Comments
 (0)