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:
+1
-1
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user