summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2016-12-19 20:33:37 +0100
committerandroid-build-merger <android-build-merger@google.com>2016-12-19 20:33:37 +0100
commitc46af77cfccfa65fa166b788d46535a1dd69c4f0 (patch)
tree7da3b8bb1347f65c3f6910466f454714e5f379a6
parentRemove outdated reference to icon_installing.png am: 48be23c8ed am: 14bdbb6c77 -s ours (diff)
parentMerge "Bugfix:updater always retry apply patch failed,when memcpy failed." am: e81719dde3 am: b0337774b2 (diff)
downloadandroid_bootable_recovery-c46af77cfccfa65fa166b788d46535a1dd69c4f0.tar
android_bootable_recovery-c46af77cfccfa65fa166b788d46535a1dd69c4f0.tar.gz
android_bootable_recovery-c46af77cfccfa65fa166b788d46535a1dd69c4f0.tar.bz2
android_bootable_recovery-c46af77cfccfa65fa166b788d46535a1dd69c4f0.tar.lz
android_bootable_recovery-c46af77cfccfa65fa166b788d46535a1dd69c4f0.tar.xz
android_bootable_recovery-c46af77cfccfa65fa166b788d46535a1dd69c4f0.tar.zst
android_bootable_recovery-c46af77cfccfa65fa166b788d46535a1dd69c4f0.zip
-rw-r--r--applypatch/applypatch.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/applypatch/applypatch.cpp b/applypatch/applypatch.cpp
index 95389da6e..8682e128b 100644
--- a/applypatch/applypatch.cpp
+++ b/applypatch/applypatch.cpp
@@ -332,6 +332,17 @@ int WriteToPartition(const unsigned char* data, size_t len, const std::string& t
success = true;
break;
}
+
+ if (ota_close(fd) != 0) {
+ printf("failed to close %s: %s\n", partition, strerror(errno));
+ return -1;
+ }
+
+ fd.reset(ota_open(partition, O_RDWR));
+ if (fd == -1) {
+ printf("failed to reopen %s for retry write && verify: %s\n", partition, strerror(errno));
+ return -1;
+ }
}
if (!success) {