Skip to content

Commit ecd9b0d

Browse files
committed
liblp: fix host lpdump cannot work issue
If a relative path is provided on linux host, lpdump will not work because GetPartitionAbsolutePath return an incorrect pathname. Test: lpdump super.img Change-Id: I7d0f10110eb72745edba810bdf288e2506bfedd6 Signed-off-by: lijiazi <[email protected]>
1 parent 51b127c commit ecd9b0d

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

fs_mgr/liblp/partition_opener.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@ using android::base::unique_fd;
3838
namespace {
3939

4040
std::string GetPartitionAbsolutePath(const std::string& path) {
41+
#if !defined(__ANDROID__)
42+
return path;
43+
#else
4144
if (android::base::StartsWith(path, "/")) {
4245
return path;
4346
}
@@ -56,6 +59,7 @@ std::string GetPartitionAbsolutePath(const std::string& path) {
5659
}
5760
}
5861
return by_name;
62+
#endif
5963
}
6064

6165
bool GetBlockDeviceInfo(const std::string& block_device, BlockDeviceInfo* device_info) {

0 commit comments

Comments
 (0)