diff options
author | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-07-27 00:30:09 +0300 |
---|---|---|
committer | Paul Sokolovsky <pfalcon@users.sourceforge.net> | 2016-07-27 00:30:09 +0300 |
commit | ade36806c8b81cd6509b6823b908e38ae747805f (patch) | |
tree | a7224b198483be0ed1eb604c4f6b80eb85cb93d4 | |
parent | 8fac939889c6f2db36cc8f1290605812305cea59 (diff) | |
download | micropython-ade36806c8b81cd6509b6823b908e38ae747805f.tar.gz micropython-ade36806c8b81cd6509b6823b908e38ae747805f.zip |
unix/file: ioctl(): Check that file is open before operations.
-rw-r--r-- | unix/file.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/unix/file.c b/unix/file.c index 4d3a9f3621..2c8652d7fb 100644 --- a/unix/file.c +++ b/unix/file.c @@ -105,6 +105,7 @@ STATIC mp_uint_t fdfile_write(mp_obj_t o_in, const void *buf, mp_uint_t size, in STATIC mp_uint_t fdfile_ioctl(mp_obj_t o_in, mp_uint_t request, uintptr_t arg, int *errcode) { mp_obj_fdfile_t *o = MP_OBJ_TO_PTR(o_in); + check_fd_is_open(o_in); switch (request) { case MP_STREAM_SEEK: { struct mp_stream_seek_t *s = (struct mp_stream_seek_t*)arg; |