wut/libraries/wutdevoptab_sd/devoptab_sd_dirreset.c

24 lines
436 B
C
Raw Normal View History

2018-06-13 14:36:15 +02:00
#include "devoptab_sd.h"
2018-05-27 13:11:45 +02:00
int
__wut_fs_dirreset(struct _reent *r,
DIR_ITER *dirState)
{
FSStatus rc;
// Set up command block
FSCmdBlock fsCmd;
FSInitCmdBlock(&fsCmd);
__wut_fs_dir_t *dir = (__wut_fs_dir_t *)(dirState->dirStruct);
2018-06-13 14:36:15 +02:00
rc = FSRewindDir(__wut_devoptab_sd_client, &fsCmd, dir->fd, -1);
2018-05-27 13:11:45 +02:00
if (rc >= 0) {
return 0;
}
r->_errno = __wut_fs_translate_error(rc);
return -1;
}