diff options
author | Tianjie Xu <xunchang@google.com> | 2017-05-03 19:43:41 +0200 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2017-05-03 19:43:41 +0200 |
commit | 7a1c2943ab9c1d695641c274e83daf944bf4ade1 (patch) | |
tree | ab7a7b81cce7d5fa86f075d2013e69439eec40bf | |
parent | Merge "Move sysMapFile and sysReleaseMap into MemMapping class." am: fe7eecff4c (diff) | |
parent | Merge "Add a default error code when updater script aborts" (diff) | |
download | android_bootable_recovery-7a1c2943ab9c1d695641c274e83daf944bf4ade1.tar android_bootable_recovery-7a1c2943ab9c1d695641c274e83daf944bf4ade1.tar.gz android_bootable_recovery-7a1c2943ab9c1d695641c274e83daf944bf4ade1.tar.bz2 android_bootable_recovery-7a1c2943ab9c1d695641c274e83daf944bf4ade1.tar.lz android_bootable_recovery-7a1c2943ab9c1d695641c274e83daf944bf4ade1.tar.xz android_bootable_recovery-7a1c2943ab9c1d695641c274e83daf944bf4ade1.tar.zst android_bootable_recovery-7a1c2943ab9c1d695641c274e83daf944bf4ade1.zip |
-rw-r--r-- | error_code.h | 1 | ||||
-rw-r--r-- | updater/updater.cpp | 16 |
2 files changed, 10 insertions, 7 deletions
diff --git a/error_code.h b/error_code.h index cde4ee6de..0e79c87ca 100644 --- a/error_code.h +++ b/error_code.h @@ -24,6 +24,7 @@ enum ErrorCode { kZipOpenFailure, kBootreasonInBlacklist, kPackageCompatibilityFailure, + kScriptExecutionFailure, }; enum CauseCode { diff --git a/updater/updater.cpp b/updater/updater.cpp index 749c86a1f..1be8b6040 100644 --- a/updater/updater.cpp +++ b/updater/updater.cpp @@ -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) { |