From a5cb7badf084053a57a5751c2600e308e62ac20b Mon Sep 17 00:00:00 2001 From: Cedric Koch-Hofer Date: Sat, 28 Oct 2023 12:12:19 +0000 Subject: [PATCH] DAOS-14532 gurt: Replace environment APIs hook Replace getenv() with d_agetenv_str() and d_freeenv_str(). Features: mpiio dfuse Required-githooks: true Signed-off-by: Cedric Koch-Hofer --- src/tests/suite/dfs_test.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/tests/suite/dfs_test.c b/src/tests/suite/dfs_test.c index 217f30ad178..29e37a0b759 100644 --- a/src/tests/suite/dfs_test.c +++ b/src/tests/suite/dfs_test.c @@ -168,14 +168,16 @@ main(int argc, char **argv) } /** if writing XML, force all ranks other than rank 0 to use stdout to avoid conflicts */ - cmocka_message_output = getenv("CMOCKA_MESSAGE_OUTPUT"); + d_agetenv_str(&cmocka_message_output, "CMOCKA_MESSAGE_OUTPUT"); if (rank != 0 && cmocka_message_output && strcasecmp(cmocka_message_output, "xml") == 0) { + d_freeenv_str(&cmocka_message_output); rc = d_setenv("CMOCKA_MESSAGE_OUTPUT", "stdout", 1); if (rc) { print_message("d_setenv() failed with %d\n", rc); return -1; } } + d_freeenv_str(&cmocka_message_output); nr_failed = run_specified_tests(tests, rank, size, NULL, 0);