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-28 17:24:24 -07:00
parent f7466f9f23
commit 2f5feedf1d
14 changed files with 112 additions and 128 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ set_usb_driver(bool enabled) {
ui->Print("failed to open driver control: %s\n", strerror(errno));
return;
}
if (write(fd, enabled ? "1" : "0", 1) < 0) {
if (TEMP_FAILURE_RETRY(write(fd, enabled ? "1" : "0", 1)) == -1) {
ui->Print("failed to set driver control: %s\n", strerror(errno));
}
if (close(fd) < 0) {