summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2018-11-09 00:55:39 +0100
committerandroid-build-merger <android-build-merger@google.com>2018-11-09 00:55:39 +0100
commit42ccdcd33774b1fd769afbf4fab702c321be99aa (patch)
tree2700cccf121a9199e94ea8c789d06aac5e49bde9
parentMerge "minui: GRSurface manages data with std::unique_ptr." am: 481613b35f am: 6f42a59e7d (diff)
parentMerge "Check and dump the signal info for killed updater." am: 02a945556e (diff)
downloadandroid_bootable_recovery-42ccdcd33774b1fd769afbf4fab702c321be99aa.tar
android_bootable_recovery-42ccdcd33774b1fd769afbf4fab702c321be99aa.tar.gz
android_bootable_recovery-42ccdcd33774b1fd769afbf4fab702c321be99aa.tar.bz2
android_bootable_recovery-42ccdcd33774b1fd769afbf4fab702c321be99aa.tar.lz
android_bootable_recovery-42ccdcd33774b1fd769afbf4fab702c321be99aa.tar.xz
android_bootable_recovery-42ccdcd33774b1fd769afbf4fab702c321be99aa.tar.zst
android_bootable_recovery-42ccdcd33774b1fd769afbf4fab702c321be99aa.zip
-rw-r--r--install.cpp11
1 files changed, 9 insertions, 2 deletions
diff --git a/install.cpp b/install.cpp
index e1e8ee879..680937dd1 100644
--- a/install.cpp
+++ b/install.cpp
@@ -497,9 +497,16 @@ static int try_update_binary(const std::string& package, ZipArchiveHandle zip, b
if (retry_update) {
return INSTALL_RETRY;
}
- if (!WIFEXITED(status) || WEXITSTATUS(status) != 0) {
- LOG(ERROR) << "Error in " << package << " (Status " << WEXITSTATUS(status) << ")";
+ if (WIFEXITED(status)) {
+ if (WEXITSTATUS(status) != EXIT_SUCCESS) {
+ LOG(ERROR) << "Error in " << package << " (status " << WEXITSTATUS(status) << ")";
+ return INSTALL_ERROR;
+ }
+ } else if (WIFSIGNALED(status)) {
+ LOG(ERROR) << "Error in " << package << " (killed by signal " << WTERMSIG(status) << ")";
return INSTALL_ERROR;
+ } else {
+ LOG(FATAL) << "Invalid status code " << status;
}
return INSTALL_SUCCESS;