summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNikita Ioffe <ioffe@google.com>2019-06-25 03:57:07 -0700
committerandroid-build-merger <android-build-merger@google.com>2019-06-25 03:57:07 -0700
commit19606437413a285b81830df9fd1dfd9dabcd5117 (patch)
tree3d94fbeea5361b5c986831704d1ea6ef3a600bc2
parent862cc53a1b926efff7cdd2a6387f0f4b96bd6714 (diff)
parent8a8a356efa93acf20f88dffae7da211aba276513 (diff)
downloadapex-19606437413a285b81830df9fd1dfd9dabcd5117.tar.gz
Add missing return statement in ApexFile.verifyDescriptor
am: 8a8a356efa Change-Id: I32264f5019c3d9615f440182943303e496ec2ffb
-rw-r--r--apexd/apex_database.cpp5
-rw-r--r--apexd/apex_file.cpp2
-rw-r--r--apexd/apexd.cpp19
3 files changed, 21 insertions, 5 deletions
diff --git a/apexd/apex_database.cpp b/apexd/apex_database.cpp
index 53793659..0a8f1377 100644
--- a/apexd/apex_database.cpp
+++ b/apexd/apex_database.cpp
@@ -152,7 +152,7 @@ inode_map scanFlattendedPackages() {
inode_map map;
for (const auto& dir : kApexPackageBuiltinDirs) {
- WalkDir(dir, [&](const fs::directory_entry& entry) {
+ auto status = WalkDir(dir, [&](const fs::directory_entry& entry) {
const auto& path = entry.path();
if (isFlattenedApex(path)) {
auto inode = inodeFor(path);
@@ -161,6 +161,9 @@ inode_map scanFlattendedPackages() {
}
}
});
+ if (!status.Ok()) {
+ LOG(ERROR) << "Failed to walk " << dir << " : " << status.ErrorMessage();
+ }
}
return map;
diff --git a/apexd/apex_file.cpp b/apexd/apex_file.cpp
index 80e60522..9f630ddb 100644
--- a/apexd/apex_file.cpp
+++ b/apexd/apex_file.cpp
@@ -391,7 +391,7 @@ StatusOr<std::unique_ptr<AvbHashtreeDescriptor>> verifyDescriptor(
if (!avb_hashtree_descriptor_validate_and_byteswap(desc,
verifiedDesc.get())) {
- StatusOr<std::unique_ptr<AvbHashtreeDescriptor>>::MakeError(
+ return StatusOr<std::unique_ptr<AvbHashtreeDescriptor>>::MakeError(
"Couldn't validate AvbDescriptor.");
}
diff --git a/apexd/apexd.cpp b/apexd/apexd.cpp
index 355934d6..4f5ca521 100644
--- a/apexd/apexd.cpp
+++ b/apexd/apexd.cpp
@@ -1381,7 +1381,11 @@ void scanStagedSessionsDirAndStage() {
auto session_failed_fn = [&]() {
LOG(WARNING) << "Marking session " << sessionId << " as failed.";
- session.UpdateStateAndCommit(SessionState::ACTIVATION_FAILED);
+ auto st = session.UpdateStateAndCommit(SessionState::ACTIVATION_FAILED);
+ if (!st.Ok()) {
+ LOG(WARNING) << "Failed to mark session " << sessionId
+ << " as failed : " << st.ErrorMessage();
+ }
};
auto scope_guard = android::base::make_scope_guard(session_failed_fn);
@@ -1446,7 +1450,11 @@ void scanStagedSessionsDirAndStage() {
// Session was OK, release scopeguard.
scope_guard.Disable();
- session.UpdateStateAndCommit(SessionState::ACTIVATED);
+ auto st = session.UpdateStateAndCommit(SessionState::ACTIVATED);
+ if (!st.Ok()) {
+ LOG(ERROR) << "Failed to mark " << session
+ << " as activated : " << st.ErrorMessage();
+ }
}
}
@@ -1668,7 +1676,12 @@ int onBootstrap() {
}
// Activate built-in APEXes for processes launched before /data is mounted.
- scanPackagesDirAndActivate(kApexPackageSystemDir);
+ status = scanPackagesDirAndActivate(kApexPackageSystemDir);
+ if (!status.Ok()) {
+ LOG(ERROR) << "Failed to activate APEX files in " << kApexPackageSystemDir
+ << " : " << status.ErrorMessage();
+ return 1;
+ }
LOG(INFO) << "Bootstrapping done";
return 0;
}