From 6c38955d73e532a6deb40b62a44348dc295f8518 Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Sat, 28 Aug 2021 12:00:04 +0700 Subject: for the tests, it seems mingw can fail too often to find/create the tmpidr, let default it to ./tmp and fail if it cannot be created/used --- tests/gdtest/gdtest.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'tests') diff --git a/tests/gdtest/gdtest.c b/tests/gdtest/gdtest.c index a902b64..12b3149 100644 --- a/tests/gdtest/gdtest.c +++ b/tests/gdtest/gdtest.c @@ -226,12 +226,6 @@ char* strrstr (char* haystack, char* needle) static char * mkdtemp (char *tmpl) { - static const char letters[] = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"; - static const int NLETTERS = sizeof (letters) - 1; - static int counter = 0; - char *XXXXXX; - struct timeval tv; - __int64 value; int count; size_t l; char attempts = 5; @@ -283,7 +277,12 @@ const char *gdTestTempDir(void) // Mingw defines it tmpdir_root = getenv("TMP"); if (tmpdir_root == NULL) { - tmpdir_root = "/tmp"; + // On MingW it seems we fail too often. Let default to this and create it ourselves + tmpdir_root = "./tmp"; + if (mkdir(tmpdir_root) == 0) { + printf("tmpdir failed to be used or initialized."); + exit(2); + } } } #endif -- cgit v1.2.1