diff options
author | Bernie Innocenti <codewiz@google.com> | 2020-02-06 22:01:51 +0900 |
---|---|---|
committer | Bernie Innocenti <codewiz@google.com> | 2020-02-09 03:59:07 +0900 |
commit | d04d5d0790feac25d86c1031036da3787c4f0307 (patch) | |
tree | 4228455ad51823fa7324a8fb33029708f77ad213 /apexd/apex_database.cpp | |
parent | f2989addaf762b252d80eb2bc479fa3e649f8278 (diff) |
Convert system/apex to Result::ok()
No functionality changes, this is a mechanical cleanup.
Test: cd system/apexd && m
Change-Id: I479084b9d1101b86c2e8d7ed631feba3edcedd8e
Diffstat (limited to 'apexd/apex_database.cpp')
-rw-r--r-- | apexd/apex_database.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/apexd/apex_database.cpp b/apexd/apex_database.cpp index 712c5f1..f8549a1 100644 --- a/apexd/apex_database.cpp +++ b/apexd/apex_database.cpp @@ -92,7 +92,7 @@ class BlockDevice { slaves.push_back(dev); } }); - if (!status) { + if (!status.ok()) { LOG(WARNING) << status.error(); } return slaves; @@ -138,7 +138,7 @@ Result<void> PopulateLoopInfo(const BlockDevice& top_device, return Error() << dev.DevPath() << " is not a loop device"; } auto backing_file = dev.GetProperty("loop/backing_file"); - if (!backing_file) { + if (!backing_file.ok()) { return backing_file.error(); } backing_files.push_back(std::move(*backing_file)); @@ -174,7 +174,7 @@ Result<MountedApexData> resolveMountInfo(const BlockDevice& block, switch (block.GetType()) { case LoopDevice: { auto backingFile = block.GetProperty("loop/backing_file"); - if (!backingFile) { + if (!backingFile.ok()) { return backingFile.error(); } return MountedApexData(block.DevPath(), *backingFile, mountPoint, @@ -183,13 +183,13 @@ Result<MountedApexData> resolveMountInfo(const BlockDevice& block, } case DeviceMapperDevice: { auto name = block.GetProperty("dm/name"); - if (!name) { + if (!name.ok()) { return name.error(); } MountedApexData result; result.mount_point = mountPoint; result.device_name = *name; - if (auto status = PopulateLoopInfo(block, &result); !status) { + if (auto status = PopulateLoopInfo(block, &result); !status.ok()) { return status.error(); } return result; @@ -241,7 +241,7 @@ void MountedApexDatabase::PopulateFromMounts() { } auto mountData = resolveMountInfo(BlockDevice(block), mountPoint); - if (!mountData) { + if (!mountData.ok()) { LOG(WARNING) << "Can't resolve mount info " << mountData.error(); continue; } |