resolve merge conflicts of d5c7d6b to nyc-mr1-dev-plus-aosp

Change-Id: Ia041044547351a3e65b647bb9913aa18c7d2c97c
This commit is contained in:
Elliott Hughes
2016-09-26 12:52:42 -07:00
8 changed files with 40 additions and 49 deletions

View File

@@ -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;