Merge "adb: replacing fs_mgr_read_fstab() with fs_mgr_read_fstab_default()"
am: eca92a5a6f
Change-Id: I192ac96673a3c7e8b4f81c7b27fd761d445556ee
This commit is contained in:
commit
4ba84b2dd2
1 changed files with 4 additions and 6 deletions
|
|
@ -54,12 +54,10 @@ static std::string find_proc_mount(const char* dir) {
|
||||||
|
|
||||||
// Returns the device used to mount a directory in the fstab.
|
// Returns the device used to mount a directory in the fstab.
|
||||||
static std::string find_fstab_mount(const char* dir) {
|
static std::string find_fstab_mount(const char* dir) {
|
||||||
std::string fstab_filename = "/fstab." + android::base::GetProperty("ro.hardware", "");
|
std::unique_ptr<fstab, decltype(&fs_mgr_free_fstab)> fstab(fs_mgr_read_fstab_default(),
|
||||||
struct fstab* fstab = fs_mgr_read_fstab(fstab_filename.c_str());
|
fs_mgr_free_fstab);
|
||||||
struct fstab_rec* rec = fs_mgr_get_entry_for_mount_point(fstab, dir);
|
struct fstab_rec* rec = fs_mgr_get_entry_for_mount_point(fstab.get(), dir);
|
||||||
std::string dev = rec ? std::string(rec->blk_device) : "";
|
return rec ? rec->blk_device : "";
|
||||||
fs_mgr_free_fstab(fstab);
|
|
||||||
return dev;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// The proc entry for / is full of lies, so check fstab instead.
|
// The proc entry for / is full of lies, so check fstab instead.
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue