summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2009-11-05 14:32:40 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2009-11-05 14:32:40 +0000
commit9470ecdb2c3a445cf25625e62a45b77a443b102e (patch)
tree5cc438ea472cde562737812d95e2f701a05ec1ea
parent73818d685e9c61dbe25d4f65cc3791bfc5746cfc (diff)
downloadbcm5719-llvm-9470ecdb2c3a445cf25625e62a45b77a443b102e.tar.gz
bcm5719-llvm-9470ecdb2c3a445cf25625e62a45b77a443b102e.zip
Path::createDirectoryOnDisk should ignore existing directories on win32 too.
llvm-svn: 86132
-rw-r--r--llvm/lib/System/Win32/Path.inc6
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/System/Win32/Path.inc b/llvm/lib/System/Win32/Path.inc
index 46b965f4b05..573369e97d4 100644
--- a/llvm/lib/System/Win32/Path.inc
+++ b/llvm/lib/System/Win32/Path.inc
@@ -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: ");
}
}
OpenPOWER on IntegriCloud