fixed to work with mingw compileation
authorGengbin Zheng <gzheng@illinois.edu>
Thu, 26 Jun 2008 05:18:52 +0000 (05:18 +0000)
committerGengbin Zheng <gzheng@illinois.edu>
Thu, 26 Jun 2008 05:18:52 +0000 (05:18 +0000)
src/conv-core/convcore.c
src/conv-core/isomalloc.c

index d7acf8786da1a714a32acc320f782bdedaec5781..fba9961a921da953a35cf4c7598156a636b793e4 100644 (file)
@@ -2385,7 +2385,11 @@ void CmiMkdir(const char *dirName) {
 #include <sys/types.h>
 
 void CmiMkdir(const char *dirName) {
+#ifndef __MINGW_H
        mkdir(dirName,0777);
+#else
+       mkdir(dirName);
+#endif
 }
 
 #endif
index 396d90a3e1634e32ff00deee2bb99cef2a97025d..8b261f8efda7bf63ed8cb074cbf20433309e2c4f 100644 (file)
@@ -20,6 +20,7 @@ generalized by Orion Lawlor November 2001.
 
 #define CMK_THREADS_DEBUG 0
 
+#include <fcntl.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <errno.h> /* just so I can find dynamically-linked symbols */
@@ -731,7 +732,11 @@ static void init_ranges(char **argv)
 
               /* write region into file */
             sprintf(fname,".isomalloc.%d", CmiMyNode());
-            while ((fd = open(fname, O_WRONLY|O_TRUNC|O_CREAT, 0644)) == -1) sleep(1);
+            while ((fd = open(fname, O_WRONLY|O_TRUNC|O_CREAT, 0644)) == -1) 
+#ifndef __MINGW_H
+              sleep(1)
+#endif
+            ;
             write(fd, &s, sizeof(CmiUInt8));
             write(fd, &e, sizeof(CmiUInt8));
             close(fd);
@@ -743,7 +748,11 @@ static void init_ranges(char **argv)
               char fname[128];
               if (i==CmiMyNode()) continue;
               sprintf(fname,".isomalloc.%d", i);
-              while ((fd = open(fname, O_RDONLY)) == -1) sleep(1);
+              while ((fd = open(fname, O_RDONLY)) == -1)
+#ifndef __MINGW_H
+              sleep(1)
+#endif
+              ;
               read(fd, &ss, sizeof(CmiUInt8));
               read(fd, &ee, sizeof(CmiUInt8));
               close(fd);