Skip to content
This repository was archived by the owner on Sep 16, 2024. It is now read-only.

Commit 8455e6b

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 ea696eb commit 8455e6b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

esp32/littlefs/vfs_littlefs_file.c

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

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

0 commit comments

Comments
 (0)