diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/page_buffer.c | 20 | ||||
-rw-r--r-- | test/vfd_swmr_bigset_writer.c | 3 | ||||
-rw-r--r-- | test/vfd_swmr_group_writer.c | 3 | ||||
-rw-r--r-- | test/vfd_swmr_zoo_writer.c | 3 |
4 files changed, 15 insertions, 14 deletions
diff --git a/test/page_buffer.c b/test/page_buffer.c index 112ea77..db1688d 100644 --- a/test/page_buffer.c +++ b/test/page_buffer.c @@ -139,23 +139,21 @@ swmr_fapl_augment(hid_t fapl, const char *filename, uint32_t max_lag) , .writer = true , .md_pages_reserved = 128 }; - const char *bname, *dname; - char *tname[2]; + char *bname = NULL; + char *dname = NULL; - if ((tname[0] = strdup(filename)) == NULL) { - HDfprintf(stderr, "temporary string allocation failed\n"); + if (H5_dirname(filename, &dname) < 0) { + HDfprintf(stderr, "H5_dirname() failed\n"); return -1; } - if ((tname[1] = strdup(filename)) == NULL) { - HDfprintf(stderr, "temporary string allocation failed\n"); + if (H5_basename(filename, &bname) < 0) { + HDfprintf(stderr, "H5_basename() failed\n"); return -1; } - dname = HDdirname(tname[0]); - bname = HDbasename(tname[1]); - snprintf(config.md_file_path, sizeof(config.md_file_path), + HDsnprintf(config.md_file_path, sizeof(config.md_file_path), "%s/%s.shadow", dname, bname); - free(tname[0]); - free(tname[1]); + HDfree(dname); + HDfree(bname); /* Enable VFD SWMR configuration */ if(H5Pset_vfd_swmr_config(fapl, &config) < 0) { diff --git a/test/vfd_swmr_bigset_writer.c b/test/vfd_swmr_bigset_writer.c index 7b0f451..4bf08fd 100644 --- a/test/vfd_swmr_bigset_writer.c +++ b/test/vfd_swmr_bigset_writer.c @@ -67,6 +67,7 @@ */ #include <err.h> +#include <libgen.h> #define H5C_FRIEND /*suppress error about including H5Cpkg */ #define H5F_FRIEND /*suppress error about including H5Fpkg */ @@ -270,7 +271,7 @@ state_init(state_t *s, int argc, char **argv) *s = state_initializer(); esnprintf(tfile, sizeof(tfile), "%s", argv[0]); - esnprintf(s->progname, sizeof(s->progname), "%s", HDbasename(tfile)); + esnprintf(s->progname, sizeof(s->progname), "%s", basename(tfile)); while ((ch = getopt(argc, argv, "FMSVWa:bc:d:n:qr:s:u:")) != -1) { switch (ch) { diff --git a/test/vfd_swmr_group_writer.c b/test/vfd_swmr_group_writer.c index 2f355c2..155e9b1 100644 --- a/test/vfd_swmr_group_writer.c +++ b/test/vfd_swmr_group_writer.c @@ -12,6 +12,7 @@ */ #include <err.h> +#include <libgen.h> #define H5F_FRIEND /*suppress error about including H5Fpkg */ @@ -84,7 +85,7 @@ state_init(state_t *s, int argc, char **argv) *s = ALL_HID_INITIALIZER; esnprintf(tfile, sizeof(tfile), "%s", argv[0]); - esnprintf(s->progname, sizeof(s->progname), "%s", HDbasename(tfile)); + esnprintf(s->progname, sizeof(s->progname), "%s", basename(tfile)); while ((ch = getopt(argc, argv, "SWa:bn:qu:")) != -1) { switch (ch) { diff --git a/test/vfd_swmr_zoo_writer.c b/test/vfd_swmr_zoo_writer.c index 1792a93..9ede006 100644 --- a/test/vfd_swmr_zoo_writer.c +++ b/test/vfd_swmr_zoo_writer.c @@ -12,6 +12,7 @@ */ #include <err.h> +#include <libgen.h> #define H5C_FRIEND /* suppress error about including H5Cpkg */ #define H5F_FRIEND /* suppress error about including H5Fpkg */ @@ -223,7 +224,7 @@ main(int argc, char **argv) const char *seedvar = "H5_ZOO_STEP_SEED"; bool use_vfd_swmr = true; bool print_estack = false; - const char *progname = HDbasename(argv[0]); + const char *progname = basename(argv[0]); const char *personality = strstr(progname, "vfd_swmr_zoo_"); estack_state_t es; char step = 'b'; |