mirror of https://gitee.com/openkylin/linux.git
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:
parent
efa86e9fa8
commit
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue