diff options
author | Tianjie Xu <xunchang@google.com> | 2017-01-10 20:00:14 +0100 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-01-10 20:00:15 +0100 |
commit | 37d74f3e201d6ac06d8e8ad3dcef3e848a54183f (patch) | |
tree | 6af1a1b73d21358e28f9bb898e5298e91d87c346 /otafault/config.cpp | |
parent | Merge "Address review comment." (diff) | |
parent | Do not inject I/O fault on a retry (diff) | |
download | android_bootable_recovery-37d74f3e201d6ac06d8e8ad3dcef3e848a54183f.tar android_bootable_recovery-37d74f3e201d6ac06d8e8ad3dcef3e848a54183f.tar.gz android_bootable_recovery-37d74f3e201d6ac06d8e8ad3dcef3e848a54183f.tar.bz2 android_bootable_recovery-37d74f3e201d6ac06d8e8ad3dcef3e848a54183f.tar.lz android_bootable_recovery-37d74f3e201d6ac06d8e8ad3dcef3e848a54183f.tar.xz android_bootable_recovery-37d74f3e201d6ac06d8e8ad3dcef3e848a54183f.tar.zst android_bootable_recovery-37d74f3e201d6ac06d8e8ad3dcef3e848a54183f.zip |
Diffstat (limited to 'otafault/config.cpp')
-rw-r--r-- | otafault/config.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/otafault/config.cpp b/otafault/config.cpp index ee4ef8911..8590833ee 100644 --- a/otafault/config.cpp +++ b/otafault/config.cpp @@ -29,21 +29,23 @@ #define OTAIO_MAX_FNAME_SIZE 128 static ZipArchiveHandle archive; +static bool is_retry = false; static std::map<std::string, bool> should_inject_cache; static std::string get_type_path(const char* io_type) { return android::base::StringPrintf("%s/%s", OTAIO_BASE_DIR, io_type); } -void ota_io_init(ZipArchiveHandle za) { +void ota_io_init(ZipArchiveHandle za, bool retry) { archive = za; + is_retry = retry; ota_set_fault_files(); } bool should_fault_inject(const char* io_type) { // archive will be NULL if we used an entry point other // than updater/updater.cpp:main - if (archive == NULL) { + if (archive == nullptr || is_retry) { return false; } const std::string type_path = get_type_path(io_type); |