소스 검색

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");