Skip to content

Commit 8baf148

Browse files
robert-hhpeter-pycom
authored andcommitted
vfs_littlefs_file.c: Move tagging files as closed.
Move it behind the error check for the close.
1 parent 9499afd commit 8baf148

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

esp32/littlefs/vfs_littlefs_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,11 +108,11 @@ STATIC mp_uint_t file_obj_ioctl(mp_obj_t o_in, mp_uint_t request, uintptr_t arg,
108108
int res = littlefs_close_common_helper(&self->littlefs->lfs, &self->fp, &self->cfg, &self->timestamp_update);
109109
xSemaphoreGive(self->littlefs->mutex);
110110

111-
self->littlefs = NULL; // indicate a closed file
112111
if (res < 0) {
113112
*errcode = littleFsErrorToErrno(res);
114113
return MP_STREAM_ERROR;
115114
}
115+
self->littlefs = NULL; // indicate a closed file
116116
return 0;
117117
} else {
118118
*errcode = MP_EINVAL;

0 commit comments

Comments
 (0)