Skip to content

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]>
  • Loading branch information
pks-t committed Aug 20, 2024
1 parent e379ea8 commit 49a2109
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 49a2109

Please sign in to comment.