Merge pull request #252 from Ziggeo/fix-create-cache-directories

This fixes an issue with caching when the creation of a subdirectory …
This commit is contained in:
Takeshi Nakatani 2015-08-23 10:48:08 +09:00
commit 1fc56e6665

View File

@ -549,14 +549,12 @@ int mkdirp(const string& path, mode_t mode)
string base;
string component;
stringstream ss(path);
int result = 0;
while (getline(ss, component, '/')) {
base += "/" + component;
int result = mkdir(base.c_str(), mode);
if(0 != result){
return result;
}
result = mkdir(base.c_str(), mode);
}
return 0;
return result;
}
bool delete_files_in_dir(const char* dir, bool is_remove_own)