From 93ac7a0bb1ff07f3357009b5198c3b88cc8bbb90 Mon Sep 17 00:00:00 2001 From: Ethan Yonker Date: Mon, 7 Nov 2016 22:05:58 -0600 Subject: Check if mount point is dir during startup 7.0 trees tend to create a /vendor symlink in the root of the ramdisk. TWRP needs to delete the symlink and mkdir to be able to mount the partition properly. Change-Id: Ia338739e07ca16ccd2492ea1fec2f5e99cfc08eb --- partition.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/partition.cpp b/partition.cpp index d6cadf902..3f2374a47 100644 --- a/partition.cpp +++ b/partition.cpp @@ -778,6 +778,8 @@ bool TWPartition::Is_Image(string File_System) { } bool TWPartition::Make_Dir(string Path, bool Display_Error) { + if (TWFunc::Get_D_Type_From_Stat(Path) != S_IFDIR) + unlink(Path.c_str()); if (!TWFunc::Path_Exists(Path)) { if (mkdir(Path.c_str(), 0777) == -1) { if (Display_Error) -- cgit v1.2.3