summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-07-27 00:30:09 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2016-07-27 00:30:09 +0300
commitade36806c8b81cd6509b6823b908e38ae747805f (patch)
treea7224b198483be0ed1eb604c4f6b80eb85cb93d4
parent8fac939889c6f2db36cc8f1290605812305cea59 (diff)
downloadmicropython-ade36806c8b81cd6509b6823b908e38ae747805f.tar.gz
micropython-ade36806c8b81cd6509b6823b908e38ae747805f.zip
unix/file: ioctl(): Check that file is open before operations.
-rw-r--r--unix/file.c1
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;