This fixes an issue with caching when the creation of a subdirectory within the cache is aborted because a common cached parent directory already exists.

This commit is contained in:
Oliver Friedmann 2015-08-21 19:30:04 -04:00
parent eb97054f49
commit d7d96907cf

View File

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