diff options
author | Elliott Hughes <enh@google.com> | 2016-09-26 21:42:16 +0200 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-09-26 21:42:16 +0200 |
commit | d5c7d6bffe9d03c79c2504f7cbb5091ac377a6c5 (patch) | |
tree | 4f7aa2ba4ccf0fc29fb709346392e0b9aa33442d /uncrypt/bootloader_message_writer.cpp | |
parent | Merge "Check corruption when reading uncrypt_status file" am: 3cf815a6a9 (diff) | |
parent | Merge "Switch to <android-base/properties.h>." (diff) | |
download | android_bootable_recovery-d5c7d6bffe9d03c79c2504f7cbb5091ac377a6c5.tar android_bootable_recovery-d5c7d6bffe9d03c79c2504f7cbb5091ac377a6c5.tar.gz android_bootable_recovery-d5c7d6bffe9d03c79c2504f7cbb5091ac377a6c5.tar.bz2 android_bootable_recovery-d5c7d6bffe9d03c79c2504f7cbb5091ac377a6c5.tar.lz android_bootable_recovery-d5c7d6bffe9d03c79c2504f7cbb5091ac377a6c5.tar.xz android_bootable_recovery-d5c7d6bffe9d03c79c2504f7cbb5091ac377a6c5.tar.zst android_bootable_recovery-d5c7d6bffe9d03c79c2504f7cbb5091ac377a6c5.zip |
Diffstat (limited to '')
-rw-r--r-- | uncrypt/bootloader_message_writer.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/uncrypt/bootloader_message_writer.cpp b/uncrypt/bootloader_message_writer.cpp index 3bb106aa0..db52121eb 100644 --- a/uncrypt/bootloader_message_writer.cpp +++ b/uncrypt/bootloader_message_writer.cpp @@ -17,12 +17,12 @@ #include <errno.h> #include <fcntl.h> #include <string.h> -#include <sys/system_properties.h> #include <string> #include <vector> #include <android-base/file.h> +#include <android-base/properties.h> #include <android-base/stringprintf.h> #include <android-base/unique_fd.h> #include <fs_mgr.h> @@ -30,14 +30,13 @@ #include "bootloader.h" static struct fstab* read_fstab(std::string* err) { - // The fstab path is always "/fstab.${ro.hardware}". - std::string fstab_path = "/fstab."; - char value[PROP_VALUE_MAX]; - if (__system_property_get("ro.hardware", value) == 0) { + std::string ro_hardware = android::base::GetProperty("ro.hardware", ""); + if (ro_hardware.empty()) { *err = "failed to get ro.hardware"; return nullptr; } - fstab_path += value; + // The fstab path is always "/fstab.${ro.hardware}". + std::string fstab_path = "/fstab." + ro_hardware; struct fstab* fstab = fs_mgr_read_fstab(fstab_path.c_str()); if (fstab == nullptr) { *err = "failed to read " + fstab_path; |