wut/libraries/wutdevoptab_sd/devoptab_sd_close.c

23 lines
404 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_close(struct _reent *r,
void *fd)
{
FSStatus rc;
__wut_fs_file_t *file = (__wut_fs_file_t *)fd;
// Set up command block
FSCmdBlock fsCmd;
FSInitCmdBlock(&fsCmd);
2018-06-13 14:36:15 +02:00
rc = FSCloseFile(__wut_devoptab_sd_client, &fsCmd, file->fd, -1);
2018-05-27 13:11:45 +02:00
if (rc >= 0) {
return 0;
}
r->_errno = __wut_fs_translate_error(rc);
return -1;
}