aboutsummaryrefslogtreecommitdiffstats
path: root/minui
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2015-04-28 17:24:24 -0700
committerElliott Hughes <enh@google.com>2015-04-29 21:14:56 -0700
commit2f5feedf1d705b53e5bf90c8b5207dd91f4522f1 (patch)
treee2c357667b0e76e6fa5a43c7a7951c872c373e9c /minui
parentf7466f9f2334b0e9025e1c7ecf65b4d04a246b20 (diff)
downloadbootable_recovery-2f5feedf1d705b53e5bf90c8b5207dd91f4522f1.zip
bootable_recovery-2f5feedf1d705b53e5bf90c8b5207dd91f4522f1.tar.gz
bootable_recovery-2f5feedf1d705b53e5bf90c8b5207dd91f4522f1.tar.bz2
Check all lseek calls succeed.
Also add missing TEMP_FAILURE_RETRYs on read, write, and lseek. Bug: http://b/20625546 Change-Id: I03b198e11c1921b35518ee2dd005a7cfcf4fd94b (cherry picked from commit 7bad7c4646ee8fd8d6e6ed0ffd3ddbb0c1b41a2f)
Diffstat (limited to 'minui')
-rw-r--r--minui/events.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/minui/events.cpp b/minui/events.cpp
index 2d47a58..3b2262a 100644
--- a/minui/events.cpp
+++ b/minui/events.cpp
@@ -15,6 +15,7 @@
*/
#include <dirent.h>
+#include <errno.h>
#include <fcntl.h>
#include <stdio.h>
#include <stdlib.h>
@@ -165,7 +166,7 @@ void ev_dispatch(void) {
int ev_get_input(int fd, uint32_t epevents, input_event* ev) {
if (epevents & EPOLLIN) {
- ssize_t r = read(fd, ev, sizeof(*ev));
+ ssize_t r = TEMP_FAILURE_RETRY(read(fd, ev, sizeof(*ev)));
if (r == sizeof(*ev)) {
return 0;
}