Browse Source

Also try TEMP and TMP environment variables, not only TMPDIR

Samuel Thibault 8 years ago
parent
commit
ec72b21232
2 changed files with 8 additions and 0 deletions
  1. 4 0
      src/common/utils.c
  2. 4 0
      src/datawizard/malloc.c

+ 4 - 0
src/common/utils.c

@@ -464,6 +464,10 @@ char *_starpu_get_home_path(void)
 		static int warn;
 		path = starpu_getenv("TMPDIR");
 		if (!path)
+			path = starpu_getenv("TEMP");
+		if (!path)
+			path = starpu_getenv("TMP");
+		if (!path)
 			path = "/tmp";
 		if (!warn)
 		{

+ 4 - 0
src/datawizard/malloc.c

@@ -251,6 +251,10 @@ int starpu_malloc_flags(void **A, size_t dim, int flags)
 			{
 				char *path = starpu_getenv("TMPDIR");
 				if (!path)
+					path = starpu_getenv("TEMP");
+				if (!path)
+					path = starpu_getenv("TMP");
+				if (!path)
 					path = "/tmp";
 				/* Create bogus file if not done already */
 				char *name = _starpu_mktemp(path, O_RDWR | O_BINARY, &bogusfile);