diff --git a/tools/iio/iio_event_monitor.c b/tools/iio/iio_event_monitor.c index 1dba09062a64..703f4cb0e8e9 100644 --- a/tools/iio/iio_event_monitor.c +++ b/tools/iio/iio_event_monitor.c @@ -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); }