summaryrefslogtreecommitdiffstats
path: root/src/H5F.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5F.c')
-rw-r--r--src/H5F.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/H5F.c b/src/H5F.c
index 38b90f8..c753180 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -903,10 +903,18 @@ H5Fget_access_plist(hid_t file_id)
if(H5P_set(new_plist, H5F_ACS_SDATA_BLOCK_SIZE_NAME, &(f->shared->lf->def_sdata_block_size)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set 'small data' cache size");
+ /*
+ * Since we're resetting the driver ID and info, close them if they
+ * exist in this new property list.
+ */
+ if (H5F_acs_close(ret_value, NULL) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTFREE, FAIL, "can't free the old driver information");
+
if(H5P_set(new_plist, H5F_ACS_FILE_DRV_ID_NAME, &(f->shared->lf->driver_id)) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set file driver ID");
driver_info = H5FD_fapl_get(f->shared->lf);
+
if(driver_info != NULL && H5P_set(new_plist, H5F_ACS_FILE_DRV_INFO_NAME, &driver_info) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set file driver info");