Use umount2 for UnMount function
This allows specifying additional umount flags when using UnMount-based functions
Change-Id: Idb89ec59315bc11bbbe262a23b4a779e03a3f2d5
diff --git a/partition.cpp b/partition.cpp
index cd46420..3f27d12 100755
--- a/partition.cpp
+++ b/partition.cpp
@@ -1716,7 +1716,7 @@
return true;
}
-bool TWPartition::UnMount(bool Display_Error) {
+bool TWPartition::UnMount(bool Display_Error, int flags) {
if (Is_Mounted()) {
int never_unmount_system;
@@ -1728,9 +1728,9 @@
PartitionManager.Remove_MTP_Storage(MTP_Storage_ID);
if (!Symlink_Mount_Point.empty())
- umount(Symlink_Mount_Point.c_str());
+ umount2(Symlink_Mount_Point.c_str(), flags);
- umount(Mount_Point.c_str());
+ umount2(Mount_Point.c_str(), flags);
if (Is_Mounted()) {
if (Display_Error)
gui_msg(Msg(msg::kError, "fail_unmount=Failed to unmount '{1}' ({2})")(Mount_Point)(strerror(errno)));