2006-11-17 Atsushi Enomoto <atsushi@ximian.com>
authorAtsushi Eno <atsushieno@gmail.com>
Fri, 17 Nov 2006 09:19:49 +0000 (09:19 -0000)
committerAtsushi Eno <atsushieno@gmail.com>
Fri, 17 Nov 2006 09:19:49 +0000 (09:19 -0000)
* TempFileCollection.cs : make it work under non-libc environment.

svn path=/trunk/mcs/; revision=68053

mcs/class/System/System.CodeDom.Compiler/ChangeLog
mcs/class/System/System.CodeDom.Compiler/TempFileCollection.cs

index 5a56cc40ef400028cd1c44e7740e136aa0ddc72a..c951cdb69203cf2a1391ccf3e2da60f33da25468 100644 (file)
@@ -1,3 +1,7 @@
+2006-11-17  Atsushi Enomoto  <atsushi@ximian.com>
+
+       * TempFileCollection.cs : make it work under non-libc environment.
+
 2006-11-16  Marek Habersack  <grendello@gmail.com>
 
        * Compiler.cs: ConfigurationElement to handle the <compiler>
index 785ffb4aaa6bdeffe839759b8bedb2cf4bbe2913..d18ab43eb08dbe426614000732f9e5be6ec05caa 100644 (file)
@@ -123,13 +123,27 @@ namespace System.CodeDom.Compiler {
                        
                        // Create a subdirectory with the correct user permissions
                        int res = -1;
+                       bool win32 = false;
+                       switch (Environment.OSVersion.Platform) {
+                       case PlatformID.Win32S:
+                       case PlatformID.Win32Windows:
+                       case PlatformID.Win32NT:
+                       case PlatformID.WinCE:
+                               win32 = true;
+                               res = 0;
+                               break;
+                       }
+
                        do {
                                int num = rnd.Next ();
                                num++;
                                ownTempDir = Path.Combine (basedir, num.ToString("x"));
                                if (Directory.Exists (ownTempDir))
                                        continue;
-                               res = mkdir (ownTempDir, 0x1c0);
+                               if (win32)
+                                       Directory.CreateDirectory (ownTempDir);
+                               else
+                                       res = mkdir (ownTempDir, 0x1c0);
                                if (res != 0) {
                                        if (!Directory.Exists (ownTempDir))
                                                throw new IOException ();