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 7bad7c4646)
This commit is contained in:
Elliott Hughes
2015-04-29 21:14:56 -07:00
parent f7466f9f23
commit 2f5feedf1d
14 changed files with 112 additions and 128 deletions
+1 -1
View File
@@ -251,7 +251,7 @@ bool RecoveryUI::IsUsbConnected() {
char buf;
// USB is connected if android_usb state is CONNECTED or CONFIGURED.
int connected = (read(fd, &buf, 1) == 1) && (buf == 'C');
int connected = (TEMP_FAILURE_RETRY(read(fd, &buf, 1)) == 1) && (buf == 'C');
if (close(fd) < 0) {
printf("failed to close /sys/class/android_usb/android0/state: %s\n",
strerror(errno));