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 | e9684c682aab1b6bfd4da547d9ad395b2f831f4e (patch) | |
tree | ccbb1581275ae83727fbbc249e1fd6128f93ae76 /lib/System/Win32/Path.inc | |
parent | 131b0d2fcfa72de250f0add965f6f12aea943bf3 (diff) | |
download | external_llvm-e9684c682aab1b6bfd4da547d9ad395b2f831f4e.zip external_llvm-e9684c682aab1b6bfd4da547d9ad395b2f831f4e.tar.gz external_llvm-e9684c682aab1b6bfd4da547d9ad395b2f831f4e.tar.bz2 |
Path::createDirectoryOnDisk should ignore existing directories on win32 too.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@86132 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/System/Win32/Path.inc')
-rw-r--r-- | lib/System/Win32/Path.inc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/System/Win32/Path.inc b/lib/System/Win32/Path.inc index 46b965f..573369e 100644 --- a/lib/System/Win32/Path.inc +++ b/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: "); } } |