summaryrefslogtreecommitdiffstats
path: root/updater/updater.cpp
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2017-05-17 10:06:39 +0200
committerandroid-build-team Robot <android-build-team-robot@google.com>2017-05-17 10:06:39 +0200
commit126564f96251f3c8b06ac8a1f7ed63c783712c2b (patch)
tree2eb0429757e82efd5eca487a6504e0fa81a53a4d /updater/updater.cpp
parentMerge "minui: Fix breakage in graphics_adf." am: 54da112277 am: d66f05b82c am: 4cc6889da8 (diff)
parentMerge "updater: Update the mkfs.f2fs argument to match f2fs-tools 1.8.0." am: 494d97fe6b am: 843ca31c4c am: 9539cdb3c0 (diff)
downloadandroid_bootable_recovery-126564f96251f3c8b06ac8a1f7ed63c783712c2b.tar
android_bootable_recovery-126564f96251f3c8b06ac8a1f7ed63c783712c2b.tar.gz
android_bootable_recovery-126564f96251f3c8b06ac8a1f7ed63c783712c2b.tar.bz2
android_bootable_recovery-126564f96251f3c8b06ac8a1f7ed63c783712c2b.tar.lz
android_bootable_recovery-126564f96251f3c8b06ac8a1f7ed63c783712c2b.tar.xz
android_bootable_recovery-126564f96251f3c8b06ac8a1f7ed63c783712c2b.tar.zst
android_bootable_recovery-126564f96251f3c8b06ac8a1f7ed63c783712c2b.zip
Diffstat (limited to 'updater/updater.cpp')
-rw-r--r--updater/updater.cpp19
1 files changed, 10 insertions, 9 deletions
diff --git a/updater/updater.cpp b/updater/updater.cpp
index c09e267a5..1be8b6040 100644
--- a/updater/updater.cpp
+++ b/updater/updater.cpp
@@ -89,7 +89,7 @@ int main(int argc, char** argv) {
const char* package_filename = argv[3];
MemMapping map;
- if (sysMapFile(package_filename, &map) != 0) {
+ if (!map.MapFile(package_filename)) {
LOG(ERROR) << "failed to map package " << argv[3];
return 3;
}
@@ -193,13 +193,15 @@ int main(int argc, char** argv) {
}
}
- if (state.error_code != kNoError) {
- fprintf(cmd_pipe, "log error: %d\n", state.error_code);
- // Cause code should provide additional information about the abort;
- // report only when an error exists.
- if (state.cause_code != kNoCause) {
- fprintf(cmd_pipe, "log cause: %d\n", state.cause_code);
- }
+ // Installation has been aborted. Set the error code to kScriptExecutionFailure unless
+ // a more specific code has been set in errmsg.
+ if (state.error_code == kNoError) {
+ state.error_code = kScriptExecutionFailure;
+ }
+ fprintf(cmd_pipe, "log error: %d\n", state.error_code);
+ // Cause code should provide additional information about the abort.
+ if (state.cause_code != kNoCause) {
+ fprintf(cmd_pipe, "log cause: %d\n", state.cause_code);
}
if (updater_info.package_zip) {
@@ -213,7 +215,6 @@ int main(int argc, char** argv) {
if (updater_info.package_zip) {
CloseArchive(updater_info.package_zip);
}
- sysReleaseMap(&map);
return 0;
}