From: Patrick Steinhardt Date: Wed, 4 Sep 2024 14:16:51 +0000 (+0200) Subject: t/clar: fix compatibility with NonStop X-Git-Tag: v2.47.0-rc0~32^2~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=aa57db2822e585b623c21dc5f38fda272f272849;p=thirdparty%2Fgit.git 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 Signed-off-by: Junio C Hamano --- diff --git a/t/unit-tests/clar/clar/sandbox.h b/t/unit-tests/clar/clar/sandbox.h index 7c177f3525..e25057b7c4 100644 --- a/t/unit-tests/clar/clar/sandbox.h +++ b/t/unit-tests/clar/clar/sandbox.h @@ -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)