mirror of
https://github.com/pellepl/spiffs.git
synced 2026-08-21 01:10:02 +00:00
Merge pull request #288 from igrr/bugfix/spiffs_readdir_errcode
fix SPIFFS_readdir setting errno to SPIFFS_VIS_END at the end of iteration
This commit is contained in:
@@ -1121,6 +1121,8 @@ struct spiffs_dirent *SPIFFS_readdir(spiffs_DIR *d, struct spiffs_dirent *e) {
|
||||
d->entry = entry + 1;
|
||||
e->obj_id &= ~SPIFFS_OBJ_ID_IX_FLAG;
|
||||
ret = e;
|
||||
} else if (res == SPIFFS_VIS_END) {
|
||||
// end of iteration
|
||||
} else {
|
||||
d->fs->err_code = res;
|
||||
}
|
||||
|
||||
@@ -439,6 +439,7 @@ TEST(list_dir)
|
||||
#endif
|
||||
}
|
||||
}
|
||||
TEST_CHECK_EQ(SPIFFS_errno(FS), SPIFFS_OK);
|
||||
SPIFFS_closedir(&d);
|
||||
|
||||
TEST_CHECK(found == file_cnt);
|
||||
|
||||
Reference in New Issue
Block a user