t/clar: fix compatibility with NonStop
The NonStop platform does not have `mkdtemp()` available, which we rely on in `build_sandbox_path()`. Fix this issue by using `mktemp()` and `mkdir()` instead on this platform. This has been cherry-picked from the upstream pull request at [1]. [1]: https://github.com/clar-test/clar/pull/96 Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Patrick Steinhardt committed
Sep 4, 2024 at 16:16 UTC
aa57db2822e585b623c21dc5f38fda272f272849
1 file changed
+6
t/unit-tests/clar/clar/sandbox.h
+6
@@ -120,6 +120,12 @@ static int build_sandbox_path(void)
120
if (_mktemp(_clar_path) == NULL)
121
return -1;
122
123
+ if (mkdir(_clar_path, 0700) != 0)
124
+ return -1;
125
+#elif defined(__TANDEM)
126
+ if (mktemp(_clar_path) == NULL)
127
+ return -1;
128
+
129
if (mkdir(_clar_path, 0700) != 0)
130
return -1;
131
#elif defined(_WIN32)