summaryrefslogtreecommitdiffstats
path: root/install.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-05-03 01:51:32 +0200
committerandroid-build-merger <android-build-merger@google.com>2017-05-03 01:51:32 +0200
commit586377d1f3f0fa3c03664b702affbbf4ea0c3a9e (patch)
treec8f081f291c35d73cef9cc1c6a775c1e6a52bcb2 /install.cpp
parentMerge "recovery: Change install_package() to take std::string." am: ba365180d3 am: c0c4ae1583 (diff)
parentMerge "Move sysMapFile and sysReleaseMap into MemMapping class." am: fe7eecff4c (diff)
downloadandroid_bootable_recovery-586377d1f3f0fa3c03664b702affbbf4ea0c3a9e.tar
android_bootable_recovery-586377d1f3f0fa3c03664b702affbbf4ea0c3a9e.tar.gz
android_bootable_recovery-586377d1f3f0fa3c03664b702affbbf4ea0c3a9e.tar.bz2
android_bootable_recovery-586377d1f3f0fa3c03664b702affbbf4ea0c3a9e.tar.lz
android_bootable_recovery-586377d1f3f0fa3c03664b702affbbf4ea0c3a9e.tar.xz
android_bootable_recovery-586377d1f3f0fa3c03664b702affbbf4ea0c3a9e.tar.zst
android_bootable_recovery-586377d1f3f0fa3c03664b702affbbf4ea0c3a9e.zip
Diffstat (limited to 'install.cpp')
-rw-r--r--install.cpp6
1 files changed, 1 insertions, 5 deletions
diff --git a/install.cpp b/install.cpp
index d86f46caa..689f4a0c6 100644
--- a/install.cpp
+++ b/install.cpp
@@ -569,7 +569,7 @@ static int really_install_package(const std::string& path, bool* wipe_cache, boo
}
MemMapping map;
- if (sysMapFile(path.c_str(), &map) != 0) {
+ if (!map.MapFile(path)) {
LOG(ERROR) << "failed to map file";
return INSTALL_CORRUPT;
}
@@ -577,7 +577,6 @@ static int really_install_package(const std::string& path, bool* wipe_cache, boo
// Verify package.
if (!verify_package(map.addr, map.length)) {
log_buffer->push_back(android::base::StringPrintf("error: %d", kZipVerificationFailure));
- sysReleaseMap(&map);
return INSTALL_CORRUPT;
}
@@ -588,7 +587,6 @@ static int really_install_package(const std::string& path, bool* wipe_cache, boo
LOG(ERROR) << "Can't open " << path << " : " << ErrorCodeString(err);
log_buffer->push_back(android::base::StringPrintf("error: %d", kZipOpenFailure));
- sysReleaseMap(&map);
CloseArchive(zip);
return INSTALL_CORRUPT;
}
@@ -596,7 +594,6 @@ static int really_install_package(const std::string& path, bool* wipe_cache, boo
// Additionally verify the compatibility of the package.
if (!verify_package_compatibility(zip)) {
log_buffer->push_back(android::base::StringPrintf("error: %d", kPackageCompatibilityFailure));
- sysReleaseMap(&map);
CloseArchive(zip);
return INSTALL_CORRUPT;
}
@@ -611,7 +608,6 @@ static int really_install_package(const std::string& path, bool* wipe_cache, boo
ui->SetEnableReboot(true);
ui->Print("\n");
- sysReleaseMap(&map);
CloseArchive(zip);
return result;
}