summaryrefslogtreecommitdiffstats
path: root/install.cpp
diff options
context:
space:
mode:
authorTianjie Xu <xunchang@google.com>2016-03-10 22:27:26 +0100
committerAndroid (Google) Code Review <android-gerrit@google.com>2016-03-10 22:27:26 +0100
commitd345de66efb919e8c0d09ee5b4d8ae0d443d6c94 (patch)
tree33e073f4f17960b19336a03fb15e1a40141cb0a2 /install.cpp
parentRevert "recovery: More refactoring of WearUI" (diff)
parentReboot and retry on I/O errors (diff)
downloadandroid_bootable_recovery-d345de66efb919e8c0d09ee5b4d8ae0d443d6c94.tar
android_bootable_recovery-d345de66efb919e8c0d09ee5b4d8ae0d443d6c94.tar.gz
android_bootable_recovery-d345de66efb919e8c0d09ee5b4d8ae0d443d6c94.tar.bz2
android_bootable_recovery-d345de66efb919e8c0d09ee5b4d8ae0d443d6c94.tar.lz
android_bootable_recovery-d345de66efb919e8c0d09ee5b4d8ae0d443d6c94.tar.xz
android_bootable_recovery-d345de66efb919e8c0d09ee5b4d8ae0d443d6c94.tar.zst
android_bootable_recovery-d345de66efb919e8c0d09ee5b4d8ae0d443d6c94.zip
Diffstat (limited to '')
-rw-r--r--install.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/install.cpp b/install.cpp
index c0d007709..8a82d7bc4 100644
--- a/install.cpp
+++ b/install.cpp
@@ -144,6 +144,7 @@ try_update_binary(const char* path, ZipArchive* zip, bool* wipe_cache) {
close(pipefd[1]);
*wipe_cache = false;
+ bool retry_update = false;
char buffer[1024];
FILE* from_child = fdopen(pipefd[0], "r");
@@ -180,6 +181,8 @@ try_update_binary(const char* path, ZipArchive* zip, bool* wipe_cache) {
// to be able to reboot during installation (useful for
// debugging packages that don't exit).
ui->SetEnableReboot(true);
+ } else if (strcmp(command, "retry_update") == 0) {
+ retry_update = true;
} else {
LOGE("unknown command [%s]\n", command);
}
@@ -188,6 +191,9 @@ try_update_binary(const char* path, ZipArchive* zip, bool* wipe_cache) {
int status;
waitpid(pid, &status, 0);
+ if (retry_update) {
+ return INSTALL_RETRY;
+ }
if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
LOGE("Error in %s\n(Status %d)\n", path, WEXITSTATUS(status));
return INSTALL_ERROR;