summaryrefslogtreecommitdiff
path: root/t/unit-tests/clar/clar/sandbox.h
diff options
context:
space:
mode:
Diffstat (limited to 't/unit-tests/clar/clar/sandbox.h')
-rw-r--r--t/unit-tests/clar/clar/sandbox.h17
1 files changed, 8 insertions, 9 deletions
diff --git a/t/unit-tests/clar/clar/sandbox.h b/t/unit-tests/clar/clar/sandbox.h
index e25057b7c4..bc960f50e0 100644
--- a/t/unit-tests/clar/clar/sandbox.h
+++ b/t/unit-tests/clar/clar/sandbox.h
@@ -122,14 +122,14 @@ static int build_sandbox_path(void)
if (mkdir(_clar_path, 0700) != 0)
return -1;
-#elif defined(__TANDEM)
- if (mktemp(_clar_path) == NULL)
+#elif defined(_WIN32)
+ if (_mktemp_s(_clar_path, sizeof(_clar_path)) != 0)
return -1;
if (mkdir(_clar_path, 0700) != 0)
return -1;
-#elif defined(_WIN32)
- if (_mktemp_s(_clar_path, sizeof(_clar_path)) != 0)
+#elif defined(__sun) || defined(__TANDEM)
+ if (mktemp(_clar_path) == NULL)
return -1;
if (mkdir(_clar_path, 0700) != 0)
@@ -142,15 +142,14 @@ static int build_sandbox_path(void)
return 0;
}
-static int clar_sandbox(void)
+static void clar_sandbox(void)
{
if (_clar_path[0] == '\0' && build_sandbox_path() < 0)
- return -1;
+ clar_abort("Failed to build sandbox path.\n");
if (chdir(_clar_path) != 0)
- return -1;
-
- return 0;
+ clar_abort("Failed to change into sandbox directory '%s': %s.\n",
+ _clar_path, strerror(errno));
}
const char *clar_sandbox_path(void)