Merge pull request #745 from orozery/handle_mkdir_exists

don't fail mkdir when directory exists
This commit is contained in:
Takeshi Nakatani 2018-05-02 11:37:18 +09:00 committed by GitHub
commit 3f542e9cf5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -621,7 +621,7 @@ int mkdirp(const string& path, mode_t mode)
return EPERM;
}
}else{
if(0 != mkdir(base.c_str(), mode)){
if(0 != mkdir(base.c_str(), mode) && errno != EEXIST){
return errno;
}
}