summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--tools/iio/iio_event_monitor.c6
1 files changed, 6 insertions, 0 deletions
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);
}