summaryrefslogtreecommitdiffstats
path: root/twrp-functions.cpp
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2014-12-11 17:00:45 +0100
committerEthan Yonker <dees_troy@teamw.in>2014-12-12 16:20:42 +0100
commit4b94cfd3910de26dbca64cf746a899cbc635158b (patch)
tree9b452fb2632413e51cb3b9fd8b28e6a2bd0352f5 /twrp-functions.cpp
parentFix loading of png images in custom themes (diff)
downloadandroid_bootable_recovery-4b94cfd3910de26dbca64cf746a899cbc635158b.tar
android_bootable_recovery-4b94cfd3910de26dbca64cf746a899cbc635158b.tar.gz
android_bootable_recovery-4b94cfd3910de26dbca64cf746a899cbc635158b.tar.bz2
android_bootable_recovery-4b94cfd3910de26dbca64cf746a899cbc635158b.tar.lz
android_bootable_recovery-4b94cfd3910de26dbca64cf746a899cbc635158b.tar.xz
android_bootable_recovery-4b94cfd3910de26dbca64cf746a899cbc635158b.tar.zst
android_bootable_recovery-4b94cfd3910de26dbca64cf746a899cbc635158b.zip
Diffstat (limited to 'twrp-functions.cpp')
-rw-r--r--twrp-functions.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/twrp-functions.cpp b/twrp-functions.cpp
index 96114241f..b51024cf1 100644
--- a/twrp-functions.cpp
+++ b/twrp-functions.cpp
@@ -54,6 +54,7 @@
extern "C" {
#include "libcrecovery/common.h"
+ #include "set_metadata.h"
}
/* Execute a command */
@@ -406,9 +407,13 @@ int TWFunc::Recursive_Mkdir(string Path) {
while (pos != string::npos)
{
wholePath = pathCpy.substr(0, pos);
- if (mkdir(wholePath.c_str(), 0777) && errno != EEXIST) {
- LOGERR("Unable to create folder: %s (errno=%d)\n", wholePath.c_str(), errno);
- return false;
+ if (!TWFunc::Path_Exists(wholePath)) {
+ if (mkdir(wholePath.c_str(), 0777)) {
+ LOGERR("Unable to create folder: %s (errno=%d)\n", wholePath.c_str(), errno);
+ return false;
+ } else {
+ tw_set_default_metadata(wholePath.c_str());
+ }
}
pos = pathCpy.find("/", pos + 1);