tools:iio:iio_event_monitor: check if event is fully read
Check that the read event is of the expected size. Signed-off-by: Hartmut Knaack <knaack.h@gmx.de> Signed-off-by: Jonathan Cameron <jic23@kernel.org>
This commit is contained in:
Родитель
efa86e9fa8
Коммит
09a33f0521
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче