]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t/clar: fix compatibility with NonStop
authorPatrick Steinhardt <ps@pks.im>
Wed, 4 Sep 2024 14:16:51 +0000 (16:16 +0200)
committerJunio C Hamano <gitster@pobox.com>
Wed, 4 Sep 2024 15:41:36 +0000 (08:41 -0700)
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>
t/unit-tests/clar/clar/sandbox.h

index 7c177f3525870ca6bf3de003469b0b7f8e864004..e25057b7c490e0f0f21b6bc5cf9f5e08cbd97a78 100644 (file)
@@ -120,6 +120,12 @@ static int build_sandbox_path(void)
        if (_mktemp(_clar_path) == NULL)
                return -1;
 
+       if (mkdir(_clar_path, 0700) != 0)
+               return -1;
+#elif defined(__TANDEM)
+       if (mktemp(_clar_path) == NULL)
+               return -1;
+
        if (mkdir(_clar_path, 0700) != 0)
                return -1;
 #elif defined(_WIN32)