summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAllen Byrne <byrn@hdfgroup.org>2020-07-28 19:50:35 (GMT)
committerAllen Byrne <byrn@hdfgroup.org>2020-07-28 19:50:35 (GMT)
commitad2b0a2a63be1e4e25be56966068cf11cc4a3b5f (patch)
treefc2db2df65a7751e1fbe20084a4c6a65c1c3e654
parent3b4e7ab05250ac3e5c60d702735dae90883de686 (diff)
downloadhdf5-ad2b0a2a63be1e4e25be56966068cf11cc4a3b5f.zip
hdf5-ad2b0a2a63be1e4e25be56966068cf11cc4a3b5f.tar.gz
hdf5-ad2b0a2a63be1e4e25be56966068cf11cc4a3b5f.tar.bz2
Add missing VFD open loop
-rw-r--r--tools/lib/h5tools.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index bbd30ac..8c3623a 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -750,6 +750,7 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl_id, hbool_t use_spec
hid_t fid = H5I_INVALID_HID;
hid_t tmp_fapl_id = H5I_INVALID_HID;
hid_t used_fapl_id = H5I_INVALID_HID;
+ unsigned drivernum;
hid_t ret_value = H5I_INVALID_HID;
/*
@@ -780,6 +781,34 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl_id, hbool_t use_spec
if (fid < 0 && use_specific_driver)
H5TOOLS_GOTO_ERROR(H5I_INVALID_HID, "failed to open file using specified FAPL");
+ for (drivernum = 0; drivernum < NUM_DRIVERS; drivernum++) {
+ h5tools_vfd_info_t vfd_info;
+
+ /* Skip the log VFD as it prints out to standard out
+ * and is fundamentally SEC2 anyway.
+ */
+ if (drivernum == LOG_VFD_IDX)
+ continue;
+
+ vfd_info.info = NULL;
+ vfd_info.name = drivernames[drivernum];
+
+ /* Get a fapl reflecting the selected VFD */
+ if ((tmp_fapl_id = h5tools_get_fapl(fapl_id, &vfd_info)) < 0)
+ continue;
+
+ /* Can we open the file with this combo? */
+ if ((fid = h5tools_fopen(fname, flags, tmp_fapl_id, TRUE, drivername, drivername_size)) >= 0) {
+ used_fapl_id = tmp_fapl_id;
+ H5TOOLS_GOTO_DONE(fid);
+ }
+ else {
+ /* Close the temporary fapl */
+ H5Pclose(tmp_fapl_id);
+ tmp_fapl_id = H5I_INVALID_HID;
+ }
+ }
+
/* File was unable to be opened at all */
ret_value = H5I_INVALID_HID;