diff options
Diffstat (limited to 'extmod/vfs_posix_file.c')
-rw-r--r-- | extmod/vfs_posix_file.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/extmod/vfs_posix_file.c b/extmod/vfs_posix_file.c index 264764b4e..f3eac98ce 100644 --- a/extmod/vfs_posix_file.c +++ b/extmod/vfs_posix_file.c @@ -163,7 +163,11 @@ STATIC mp_uint_t vfs_posix_file_write(mp_obj_t o_in, const void *buf, mp_uint_t STATIC mp_uint_t vfs_posix_file_ioctl(mp_obj_t o_in, mp_uint_t request, uintptr_t arg, int *errcode) { mp_obj_vfs_posix_file_t *o = MP_OBJ_TO_PTR(o_in); - check_fd_is_open(o); + + if (request != MP_STREAM_CLOSE) { + check_fd_is_open(o); + } + switch (request) { case MP_STREAM_FLUSH: { int ret; |