forked from OSchip/llvm-project
Path::createDirectoryOnDisk should ignore existing directories on win32 too.
llvm-svn: 86132
This commit is contained in:
parent
73818d685e
commit
9470ecdb2c
|
@ -608,7 +608,8 @@ Path::createDirectoryOnDisk(bool create_parents, std::string* ErrMsg) {
|
|||
while (*next) {
|
||||
next = strchr(next, '/');
|
||||
*next = 0;
|
||||
if (!CreateDirectory(pathname, NULL))
|
||||
if (!CreateDirectory(pathname, NULL) &&
|
||||
GetLastError() != ERROR_ALREADY_EXISTS)
|
||||
return MakeErrMsg(ErrMsg,
|
||||
std::string(pathname) + ": Can't create directory: ");
|
||||
*next++ = '/';
|
||||
|
@ -616,7 +617,8 @@ Path::createDirectoryOnDisk(bool create_parents, std::string* ErrMsg) {
|
|||
} else {
|
||||
// Drop trailing slash.
|
||||
pathname[len-1] = 0;
|
||||
if (!CreateDirectory(pathname, NULL)) {
|
||||
if (!CreateDirectory(pathname, NULL) &&
|
||||
GetLastError() != ERROR_ALREADY_EXISTS) {
|
||||
return MakeErrMsg(ErrMsg, std::string(pathname) + ": Can't create directory: ");
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue