[llvm-commits] [llvm] r86132 - /llvm/trunk/lib/System/Win32/Path.inc

Benjamin Kramer benny.kra at googlemail.com
Thu Nov 5 06:32:40 PST 2009


Author: d0k
Date: Thu Nov  5 08:32:40 2009
New Revision: 86132

URL: http://llvm.org/viewvc/llvm-project?rev=86132&view=rev
Log:
Path::createDirectoryOnDisk should ignore existing directories on win32 too.

Modified:
    llvm/trunk/lib/System/Win32/Path.inc

Modified: llvm/trunk/lib/System/Win32/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/System/Win32/Path.inc?rev=86132&r1=86131&r2=86132&view=diff

==============================================================================
--- llvm/trunk/lib/System/Win32/Path.inc (original)
+++ llvm/trunk/lib/System/Win32/Path.inc Thu Nov  5 08:32:40 2009
@@ -608,7 +608,8 @@
     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 @@
   } 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: ");
     }
   }





More information about the llvm-commits mailing list