Skip to content

Commit

Permalink
tools:iio:iio_event_monitor: check if event is fully read
Browse files Browse the repository at this point in the history
Check that the read event is of the expected size.

Signed-off-by: Hartmut Knaack <[email protected]>
Signed-off-by: Jonathan Cameron <[email protected]>
  • Loading branch information
Hartmut Knaack authored and jic23 committed Jun 21, 2015
1 parent efa86e9 commit 09a33f0
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions tools/iio/iio_event_monitor.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

Expand Down

0 comments on commit 09a33f0

Please sign in to comment.