From 2f5feedf1d705b53e5bf90c8b5207dd91f4522f1 Mon Sep 17 00:00:00 2001 From: Elliott Hughes Date: Tue, 28 Apr 2015 17:24:24 -0700 Subject: 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) --- adb_install.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'adb_install.cpp') diff --git a/adb_install.cpp b/adb_install.cpp index ebd4cac..e3b94ea 100644 --- a/adb_install.cpp +++ b/adb_install.cpp @@ -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) { -- cgit v1.1