make dirnext return 0 for success & -1 for error/no more files

This commit is contained in:
Dave Murphy 2007-01-25 18:01:02 +00:00
parent 537cb4c6d7
commit e64acc0133

View File

@ -508,7 +508,8 @@ int _FAT_dirnext_r (struct _reent *r, DIR_ITER *dirState, char *filename, struct
// Make sure there is another file to report on // Make sure there is another file to report on
if (! state->validEntry) { if (! state->validEntry) {
return 0; r->_errno = ENOENT;
return -1;
} }
// Get the filename // Get the filename
@ -522,7 +523,7 @@ int _FAT_dirnext_r (struct _reent *r, DIR_ITER *dirState, char *filename, struct
state->validEntry = state->validEntry =
_FAT_directory_getNextEntry (state->partition, &(state->currentEntry)); _FAT_directory_getNextEntry (state->partition, &(state->currentEntry));
return 1; return 0;
} }
int _FAT_dirclose_r (struct _reent *r, DIR_ITER *dirState) { int _FAT_dirclose_r (struct _reent *r, DIR_ITER *dirState) {