summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2019-11-12 19:01:40 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2019-11-12 19:01:40 (GMT)
commitf1b3df09efcd130b2474385c7700be2d5ae4978f (patch)
tree5c47f481813bf92b62a31b81762f471cedc9248b
parent78dfcd4658e9b2c00a6747d7f84dd8f570373e97 (diff)
parente5fc4889fa4f412056a4672435c96c17a6d1a936 (diff)
downloadhdf5-f1b3df09efcd130b2474385c7700be2d5ae4978f.zip
hdf5-f1b3df09efcd130b2474385c7700be2d5ae4978f.tar.gz
hdf5-f1b3df09efcd130b2474385c7700be2d5ae4978f.tar.bz2
Merge pull request #2037 in HDFFV/hdf5 from ~NFORTNE2/hdf5_naf:develop to develop
* commit 'e5fc4889fa4f412056a4672435c96c17a6d1a936': Fix issue where H5R__reopen_file did not make the file "post open" callback.
-rw-r--r--src/H5F.c2
-rw-r--r--src/H5Rint.c9
2 files changed, 10 insertions, 1 deletions
diff --git a/src/H5F.c b/src/H5F.c
index 35176fc..b395ccc 100644
--- a/src/H5F.c
+++ b/src/H5F.c
@@ -768,7 +768,7 @@ H5Fopen(const char *filename, unsigned flags, hid_t fapl_id)
/* Get the file object */
if(NULL == (vol_obj = H5VL_vol_object(ret_value)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, H5I_INVALID_HID, "invalid object identifier")
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID, "invalid object identifier")
/* Make the post open callback */
if(H5VL_file_specific(vol_obj, H5VL_FILE_POST_OPEN, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
diff --git a/src/H5Rint.c b/src/H5Rint.c
index 443a245..504ae06 100644
--- a/src/H5Rint.c
+++ b/src/H5Rint.c
@@ -504,6 +504,7 @@ H5R__reopen_file(H5R_ref_priv_t *ref, hid_t fapl_id)
H5VL_connector_prop_t connector_prop;
unsigned flags = H5F_ACC_RDWR; /* Must open file read-write to allow for object modifications */
H5P_genplist_t *plist;
+ H5VL_object_t *vol_obj = NULL; /* VOL object for file */
hid_t ret_value = H5I_INVALID_HID;
FUNC_ENTER_PACKAGE
@@ -534,6 +535,14 @@ H5R__reopen_file(H5R_ref_priv_t *ref, hid_t fapl_id)
if((ret_value = H5VL_register_using_vol_id(H5I_FILE, new_file, connector_prop.connector_id, TRUE)) < 0)
HGOTO_ERROR(H5E_FILE, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to atomize file handle")
+ /* Get the file object */
+ if(NULL == (vol_obj = H5VL_vol_object(ret_value)))
+ HGOTO_ERROR(H5E_FILE, H5E_CANTGET, H5I_INVALID_HID, "invalid object identifier")
+
+ /* Make the post open callback */
+ if(H5VL_file_specific(vol_obj, H5VL_FILE_POST_OPEN, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0)
+ HGOTO_ERROR(H5E_FILE, H5E_CANTINIT, H5I_INVALID_HID, "unable to make file post open callback")
+
/* Attach loc_id to reference */
if(H5R__set_loc_id((H5R_ref_priv_t *)ref, ret_value, FALSE) < 0)
HGOTO_ERROR(H5E_REFERENCE, H5E_CANTSET, H5I_INVALID_HID, "unable to attach location id to reference")