diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2021-08-04 17:05:13 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-04 17:05:13 (GMT) |
commit | 3082cd226e7affcf693cc9f4e0380880c029a141 (patch) | |
tree | 773c26c397698a1910151278dde6cdd826bd9dcd /test | |
parent | a93e5420fa69d745dfa056eb73020cbab0baead8 (diff) | |
download | hdf5-3082cd226e7affcf693cc9f4e0380880c029a141.zip hdf5-3082cd226e7affcf693cc9f4e0380880c029a141.tar.gz hdf5-3082cd226e7affcf693cc9f4e0380880c029a141.tar.bz2 |
VFD SWMR: Fixes naked basename() call on MacOS (#874)
* Fixes naked basename() call on MacOS
* Committing clang-format changes
Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com>
Diffstat (limited to 'test')
-rw-r--r-- | test/vfd_swmr_dsetchks_writer.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/test/vfd_swmr_dsetchks_writer.c b/test/vfd_swmr_dsetchks_writer.c index 1d9bc4c..a02a042 100644 --- a/test/vfd_swmr_dsetchks_writer.c +++ b/test/vfd_swmr_dsetchks_writer.c @@ -265,10 +265,14 @@ state_init(state_t *s, int argc, char **argv) int ch; char tfile[PATH_MAX]; char * end; + char * base; + + if (H5_basename(tfile, base) < 0) + TEST_ERROR *s = ALL_HID_INITIALIZER; esnprintf(tfile, sizeof(tfile), "%s", argv[0]); - esnprintf(s->progname, sizeof(s->progname), "%s", basename(tfile)); + esnprintf(s->progname, sizeof(s->progname), "%s", base); while ((ch = getopt(argc, argv, "siferom:n:x:y:g:p:t:l:bqSNu:c:")) != -1) { switch (ch) { @@ -370,6 +374,8 @@ state_init(state_t *s, int argc, char **argv) argc -= optind; argv += optind; + HDfree(base); + /* Require to specify at least -s or -i or -f or -e or -r option */ if (!s->single_index && !s->implicit_index && !s->fa_index && !s->ea_index && !s->bt2_index) { printf("Require to specify at least -s or -i or -f or -e or -r option\n"); |