summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorPierre Joye <pierre.php@gmail.com>2021-08-28 11:20:13 +0700
committerPierre Joye <pierre.php@gmail.com>2021-08-28 11:20:13 +0700
commit5c6dcd16480894bb16ec034202f8155f5b54e701 (patch)
tree1bb9dd2b078a2b228177da5a475ca1cf5a8ec354 /tests
parent9e02f643251743d523f1f1c53e02f8cdc97c8191 (diff)
downloadlibgd-5c6dcd16480894bb16ec034202f8155f5b54e701.tar.gz
don't attempt to create it, fall back to /tmp on linux/mingw like
Diffstat (limited to 'tests')
-rw-r--r--tests/gdtest/gdtest.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/tests/gdtest/gdtest.c b/tests/gdtest/gdtest.c
index e2a2582..0ce9da9 100644
--- a/tests/gdtest/gdtest.c
+++ b/tests/gdtest/gdtest.c
@@ -301,13 +301,9 @@ const char *gdTestTempDir(void)
// Mingw defines it
tmpdir_root = getenv("TMP");
if (tmpdir_root == NULL) {
-#if defined(__MINGW32__) || defined(__MINGW64__)
- // On MingW it seems we fail too often. Let default to this and create it ourselves
- tmpdir_root = "./tmp";
- if (!gdTestIsDir(tmpdir_root) && mkdir(tmpdir_root) == 0) {
-#else
- if (!gdTestIsDir(tmpdir_root) && mkdir(tmpdir_root, 0700) == 0) {
-#endif
+ // Fall back here.
+ tmpdir_root = "/tmp";
+ if (!gdTestIsDir(tmpdir_root)) {
printf("tmpdir failed to be used or initialized (%s).", tmpdir_root);
exit(2);
}