summaryrefslogtreecommitdiffstats
path: root/bootloader_message
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2016-09-26 21:52:42 +0200
committerElliott Hughes <enh@google.com>2016-09-26 21:53:52 +0200
commit130f6c86f590b61bc3aef7883500eb4c0ba593c3 (patch)
tree2577e80d8cac345ac5aec61d6af6d0e2d7c0c862 /bootloader_message
parentFail gracefully when we fail to fork the update binary (diff)
parentMerge "Switch to <android-base/properties.h>." am: cc02f9652f (diff)
downloadandroid_bootable_recovery-130f6c86f590b61bc3aef7883500eb4c0ba593c3.tar
android_bootable_recovery-130f6c86f590b61bc3aef7883500eb4c0ba593c3.tar.gz
android_bootable_recovery-130f6c86f590b61bc3aef7883500eb4c0ba593c3.tar.bz2
android_bootable_recovery-130f6c86f590b61bc3aef7883500eb4c0ba593c3.tar.lz
android_bootable_recovery-130f6c86f590b61bc3aef7883500eb4c0ba593c3.tar.xz
android_bootable_recovery-130f6c86f590b61bc3aef7883500eb4c0ba593c3.tar.zst
android_bootable_recovery-130f6c86f590b61bc3aef7883500eb4c0ba593c3.zip
Diffstat (limited to 'bootloader_message')
-rw-r--r--bootloader_message/bootloader_message.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/bootloader_message/bootloader_message.cpp b/bootloader_message/bootloader_message.cpp
index 9de7dff40..e0c95d223 100644
--- a/bootloader_message/bootloader_message.cpp
+++ b/bootloader_message/bootloader_message.cpp
@@ -19,25 +19,24 @@
#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>
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;