Bläddra i källkod

src/core/disk_ops/disk_stdio.c: display error messages on failure

Nathalie Furmento 10 år sedan
förälder
incheckning
4ba25f673b
1 ändrade filer med 6 tillägg och 0 borttagningar
  1. 6 0
      src/core/disk_ops/disk_stdio.c

+ 6 - 0
src/core/disk_ops/disk_stdio.c

@@ -73,6 +73,7 @@ static void *starpu_stdio_alloc(void *base, size_t size)
 	/* fail */
 	if (id < 0)
 	{
+		_STARPU_DISP("Could not create temporary file in directory '%s', mskostemp failed with error '%s'\n", (char*)base, strerror(errno));
 		free(obj);
 		free(baseCpy);
 		return NULL;
@@ -98,6 +99,11 @@ static void *starpu_stdio_alloc(void *base, size_t size)
 	/* fail */
 	if (val < 0)
 	{
+#ifdef STARPU_HAVE_WINDOWS
+		_STARPU_DISP("Could not truncate file, _chsize failed with error '%s'\n", strerror(errno));
+#else
+		_STARPU_DISP("Could not truncate file, ftruncate failed with error '%s'\n", strerror(errno));
+#endif
 		fclose(f);
 		close(id);
 		unlink(baseCpy);