10000 unix/file: ioctl(): Check that file is open before operations. · sparkfun/circuitpython@ade3680 · GitHub
[go: up one dir, main page]

Skip to content

Commit ade3680

Browse files
committed
unix/file: ioctl(): Check that file is open before operations.
1 parent 8fac939 commit ade3680

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

unix/file.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@ STATIC mp_uint_t fdfile_write(mp_obj_t o_in, const void *buf, mp_uint_t size, in
105105

106106
STATIC mp_uint_t fdfile_ioctl(mp_obj_t o_in, mp_uint_t request, uintptr_t arg, int *errcode) {
107107
mp_obj_fdfile_t *o = MP_OBJ_TO_PTR(o_in);
108+
check_fd_is_open(o_in);
108109
switch (request) {
109110
case MP_STREAM_SEEK: {
110111
struct mp_stream_seek_t *s = (struct mp_stream_seek_t*)arg;

0 commit comments

Comments
 (0)
0