summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Cherry <tomcherry@google.com>2019-01-30 12:39:02 -0800
committerTom Cherry <tomcherry@google.com>2019-01-30 14:32:18 -0800
commit7af1c258e266e80f9102208d98d8cac789fca73b (patch)
tree9bf25d27fae0d61afd51112cb6d1c58d236f7675
parent99e53b4c1c12acc68778540cc9afb03f00ca9126 (diff)
downloadam57x-7af1c258e266e80f9102208d98d8cac789fca73b.tar.gz
Move to new Fstab class
Test: treehugger Change-Id: Ic28859f5b3ca22cd505b3683ef3f2db2271737a7
-rw-r--r--bootctrl/bootloader_message.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/bootctrl/bootloader_message.cpp b/bootctrl/bootloader_message.cpp
index a4634ed..aac43e6 100644
--- a/bootctrl/bootloader_message.cpp
+++ b/bootctrl/bootloader_message.cpp
@@ -29,16 +29,19 @@
#include <android-base/unique_fd.h>
#include <fstab/fstab.h>
+using android::fs_mgr::Fstab;
+using android::fs_mgr::GetEntryForMountPoint;
+using android::fs_mgr::ReadDefaultFstab;
+
constexpr off_t kBootloaderControlOffset = offsetof(bootloader_message_ab, slot_suffix);
static std::string get_misc_blk_device(std::string* err) {
- std::unique_ptr<fstab, decltype(&fs_mgr_free_fstab)> fstab(fs_mgr_read_fstab_default(),
- fs_mgr_free_fstab);
- if (!fstab) {
+ Fstab fstab;
+ if (!ReadDefaultFstab(&fstab)) {
*err = "failed to read default fstab";
return "";
}
- fstab_rec* record = fs_mgr_get_entry_for_mount_point(fstab.get(), "/misc");
+ auto record = GetEntryForMountPoint(&fstab, "/misc");
if (record == nullptr) {
*err = "failed to find /misc partition";
return "";