瀏覽代碼

tests/perfmodels/value_nan.c: on windows OSes, there is no need to open file

Nathalie Furmento 11 年之前
父節點
當前提交
4ff9b13f28
共有 1 個文件被更改,包括 9 次插入7 次删除
  1. 9 7
      tests/perfmodels/value_nan.c

+ 9 - 7
tests/perfmodels/value_nan.c

@@ -34,18 +34,20 @@ int _check_number(double val, int checknan)
 	int id;
 
 	strcpy(filename, tmp);
+
 #ifdef STARPU_HAVE_WINDOWS
         _mktemp(filename);
-        id = open(filename, _O_RDWR);
 #else
-	id = mkstemp(filename);
-
-#endif
-	/* fail */
-	if (id < 0)
 	{
-		return 1;
+	     int id = mkstemp(filename);
+	     /* fail */
+	     if (id < 0)
+	     {
+		  FPRINTF(stderr, "Error when creating temp file\n");
+		  return 1;
+	     }
 	}
+#endif
 
 	/* write the double value in the file followed by a predefined string */
 	FILE *f = fopen(filename, "w");