Skip to content

Commit

Permalink
DAOS-14532 gurt: Replace environment APIs hook
Browse files Browse the repository at this point in the history
Replace getenv() function call with d_agetenv_str() and d_freeenv_str().

Features: mpiio dfuse
Required-githooks: true
Signed-off-by: Cedric Koch-Hofer <cedric.koch-hofer@intel.com>
  • Loading branch information
kanard38 authored and knard-intel committed Jan 18, 2024
1 parent 2be8917 commit 258434a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/tests/suite/dfs_test.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 258434a

Please sign in to comment.