partitions: Avoid duplicate UMS mounts
If a device has several LUN but only one storage volume TWRP
recognizes (e.g. lun0 for microsd and lun1 for emulated cdrom), then
avoid mounting the same partition twice by checking the mount point.
Change-Id: Ie23b88acca1818873792e9f65b73b125a15e4a5d
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index 71b6557..1c59de7 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -1595,7 +1595,7 @@
}
sprintf(lun_file, CUSTOM_LUN_FILE, 1);
Mount2 = Find_Next_Storage(Mount1->Mount_Point, true);
- if (Mount2) {
+ if (Mount2 && Mount2->Mount_Point != Mount1->Mount_Point) {
Open_Lun_File(Mount2->Mount_Point, lun_file);
}
} else {