Check that the read event is of the expected size. Signed-off-by: Hartmut Knaack <knaack.h@xxxxxx> --- tools/iio/iio_event_monitor.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/iio/iio_event_monitor.c b/tools/iio/iio_event_monitor.c index 1316527..ecee8ac 100644 --- a/tools/iio/iio_event_monitor.c +++ b/tools/iio/iio_event_monitor.c @@ -304,6 +304,11 @@ int main(int argc, char **argv) } } + if (ret != sizeof(event)) { + printf("Reading event failed, trying again\n"); + continue; + } + print_event(&event); } -- 2.3.6 -- To unsubscribe from this list: send the line "unsubscribe linux-iio" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html