From 5c6dcd16480894bb16ec034202f8155f5b54e701 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Sat, 28 Aug 2021 11:20:13 +0700 Subject: don't attempt to create it, fall back to /tmp on linux/mingw like --- tests/gdtest/gdtest.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) (limited to 'tests') 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); } -- cgit v1.2.1