Skip to content
/ git Public
forked from git/git

Commit

Permalink
t/clar: fix compatibility with NonStop
Browse files Browse the repository at this point in the history
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]: clar-test/clar#96

Signed-off-by: Patrick Steinhardt <[email protected]>
Signed-off-by: Junio C Hamano <[email protected]>
  • Loading branch information
pks-t authored and gitster committed Aug 6, 2024
1 parent c8a6e7a commit 02a82fc
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions t/unit-tests/clar/clar/sandbox.h
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 02a82fc

Please sign in to comment.