diff options
author | Benjamin Kramer <benny.kra@googlemail.com> | 2009-11-05 14:32:40 +0000 |
---|---|---|
committer | Benjamin Kramer <benny.kra@googlemail.com> | 2009-11-05 14:32:40 +0000 |
commit | 9470ecdb2c3a445cf25625e62a45b77a443b102e (patch) | |
tree | 5cc438ea472cde562737812d95e2f701a05ec1ea | |
parent | 73818d685e9c61dbe25d4f65cc3791bfc5746cfc (diff) | |
download | bcm5719-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.inc | 6 |
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: "); } } |