aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTianjie Xu2017-08-23 02:18:07 -0500
committerTianjie Xu2017-08-23 02:18:07 -0500
commit3fec8c64190b6600c01f383501f55f3b9350c213 (patch)
treedd03bce2f73247f85ca7793665e6f3d3890c4036 /install.cpp
parentb4bc57ed39b4ae2e44cf7a1a1e716711a4f9af14 (diff)
downloadplatform-bootable-recovery-3fec8c64190b6600c01f383501f55f3b9350c213.tar.gz
platform-bootable-recovery-3fec8c64190b6600c01f383501f55f3b9350c213.tar.xz
platform-bootable-recovery-3fec8c64190b6600c01f383501f55f3b9350c213.zip
Add missing report of error code under recovery
Add report of kMapFileFailure, kForkUpdateBinaryFailure and kUpdateBinaryCommandFailure. Test: unit test pass; kMapFileFailure reports correctly. Change-Id: I858c81b6c750b5e300b1b12760b1f0fa8e23b47d
Diffstat (limited to 'install.cpp')
-rw-r--r--install.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/install.cpp b/install.cpp
index 7fbf5c01..80ef7154 100644
--- a/install.cpp
+++ b/install.cpp
@@ -321,6 +321,7 @@ static int try_update_binary(const std::string& package, ZipArchiveHandle zip, b
321 if (ret) { 321 if (ret) {
322 close(pipefd[0]); 322 close(pipefd[0]);
323 close(pipefd[1]); 323 close(pipefd[1]);
324 log_buffer->push_back(android::base::StringPrintf("error: %d", kUpdateBinaryCommandFailure));
324 return ret; 325 return ret;
325 } 326 }
326 327
@@ -385,6 +386,7 @@ static int try_update_binary(const std::string& package, ZipArchiveHandle zip, b
385 close(pipefd[0]); 386 close(pipefd[0]);
386 close(pipefd[1]); 387 close(pipefd[1]);
387 PLOG(ERROR) << "Failed to fork update binary"; 388 PLOG(ERROR) << "Failed to fork update binary";
389 log_buffer->push_back(android::base::StringPrintf("error: %d", kForkUpdateBinaryFailure));
388 return INSTALL_ERROR; 390 return INSTALL_ERROR;
389 } 391 }
390 392
@@ -573,6 +575,7 @@ static int really_install_package(const std::string& path, bool* wipe_cache, boo
573 MemMapping map; 575 MemMapping map;
574 if (!map.MapFile(path)) { 576 if (!map.MapFile(path)) {
575 LOG(ERROR) << "failed to map file"; 577 LOG(ERROR) << "failed to map file";
578 log_buffer->push_back(android::base::StringPrintf("error: %d", kMapFileFailure));
576 return INSTALL_CORRUPT; 579 return INSTALL_CORRUPT;
577 } 580 }
578 581