From 7bad7c4646ee8fd8d6e6ed0ffd3ddbb0c1b41a2f 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 --- 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 ebd4cac00..e3b94ea59 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.2.3 From 80e46e08de5f65702fa7f7cd3ef83f905d919bbc Mon Sep 17 00:00:00 2001 From: Tao Bao Date: Wed, 3 Jun 2015 10:49:29 -0700 Subject: recovery: Switch to clang And a few trival fixes to suppress warnings. Change-Id: I38734b5f4434643e85feab25f4807b46a45d8d65 --- 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 e3b94ea59..4cfcb2ab8 100644 --- a/adb_install.cpp +++ b/adb_install.cpp @@ -91,7 +91,7 @@ apply_from_adb(RecoveryUI* ui_, bool* wipe_cache, const char* install_file) { // FUSE_SIDELOAD_HOST_PATHNAME will start to exist once the host // connects and starts serving a package. Poll for its // appearance. (Note that inotify doesn't work with FUSE.) - int result; + int result = INSTALL_ERROR; int status; bool waited = false; struct stat st; -- cgit v1.2.3 From 162558382b768a4120b3e41090a4c7b53f11469a Mon Sep 17 00:00:00 2001 From: Tianjie Xu Date: Sat, 30 Apr 2016 11:49:59 -0700 Subject: Allow recovery to return error codes Write error code, cause code, and retry count into last_install. So we can have more information about the reason of a failed OTA. Example of new last_install: @/cache/recovery/block.map package name 0 install result retry: 1 retry count (new) error: 30 error code (new) cause: 12 error cause (new) Details in: go/android-ota-errorcode Bug: 28471955 Change-Id: I00e7153c821e7355c1be81a86c7f228108f3dc37 --- 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 4cfcb2ab8..4aed9d4b1 100644 --- a/adb_install.cpp +++ b/adb_install.cpp @@ -113,7 +113,7 @@ apply_from_adb(RecoveryUI* ui_, bool* wipe_cache, const char* install_file) { break; } } - result = install_package(FUSE_SIDELOAD_HOST_PATHNAME, wipe_cache, install_file, false); + result = install_package(FUSE_SIDELOAD_HOST_PATHNAME, wipe_cache, install_file, false, 0); break; } -- cgit v1.2.3