提交 09a33f05 编写于 作者: H Hartmut Knaack 提交者: Jonathan Cameron

tools:iio:iio_event_monitor: check if event is fully read

Check that the read event is of the expected size.
Signed-off-by: NHartmut Knaack <knaack.h@gmx.de>
Signed-off-by: NJonathan Cameron <jic23@kernel.org>
上级 efa86e9f
...@@ -310,6 +310,12 @@ int main(int argc, char **argv) ...@@ -310,6 +310,12 @@ int main(int argc, char **argv)
} }
} }
if (ret != sizeof(event)) {
printf("Reading event failed!\n");
ret = -EIO;
break;
}
print_event(&event); print_event(&event);
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册