summaryrefslogtreecommitdiffstats
path: root/data.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'data.cpp')
-rwxr-xr-xdata.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/data.cpp b/data.cpp
index cf9dd2476..92255357c 100755
--- a/data.cpp
+++ b/data.cpp
@@ -1043,6 +1043,11 @@ void DataManager::Output_Version(void)
char version[255];
std::string cacheDir = TWFunc::get_cache_dir();
+ if (cacheDir.empty()) {
+ LOGINFO("Unable to find cache directory\n");
+ return;
+ }
+
std::string recoveryCacheDir = cacheDir + "recovery/";
if (cacheDir == NON_AB_CACHE_DIR) {
@@ -1053,7 +1058,7 @@ void DataManager::Output_Version(void)
}
if (!TWFunc::Path_Exists(recoveryCacheDir)) {
LOGINFO("Recreating %s folder.\n", recoveryCacheDir.c_str());
- if (mkdir(recoveryCacheDir.c_str(), S_IRWXU | S_IRWXG | S_IWGRP | S_IXGRP) != 0) {
+ if (!TWFunc::Create_Dir_Recursive(recoveryCacheDir.c_str(), S_IRWXU | S_IRWXG | S_IWGRP | S_IXGRP, 0, 0)) {
LOGERR("DataManager::Output_Version -- Unable to make %s: %s\n", recoveryCacheDir.c_str(), strerror(errno));
return;
}