Browse Source

use /tmp by default when no path is available

Samuel Thibault 12 years ago
parent
commit
600581f117
1 changed files with 8 additions and 2 deletions
  1. 8 2
      src/common/utils.c

+ 8 - 2
src/common/utils.c

@@ -130,8 +130,14 @@ char *_starpu_get_home_path(void)
 		path = getenv("HOME");
 		path = getenv("HOME");
 	if (!path)
 	if (!path)
 		path = getenv("USERPROFILE");
 		path = getenv("USERPROFILE");
-	if (!path)
-		_STARPU_ERROR("couldn't find a home place to put starpu data\n");
+	if (!path) {
+		static int warn;
+		if (!warn) {
+			warn = 1;
+			_STARPU_DISP("couldn't find a home place to put starpu data, using /tmp\n");
+		}
+		path = "/tmp";
+	}
 	return path;
 	return path;
 }
 }