diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2018-11-01 16:22:54 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2018-11-01 16:22:54 (GMT) |
commit | a5cc4e272b73384600b2b20429d4189e820a0451 (patch) | |
tree | fbdc5c2d99394cf586709a18a0477f5484333660 /src/H5O.c | |
parent | a39486a341dd6cb1859ecd489e0d23e9fd1aa069 (diff) | |
download | hdf5-a5cc4e272b73384600b2b20429d4189e820a0451.zip hdf5-a5cc4e272b73384600b2b20429d4189e820a0451.tar.gz hdf5-a5cc4e272b73384600b2b20429d4189e820a0451.tar.bz2 |
Refactor and standardize the link VOL callbacks. Also fix error stack for
testing.
Diffstat (limited to 'src/H5O.c')
-rw-r--r-- | src/H5O.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -322,6 +322,7 @@ H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, { H5VL_object_t *vol_obj1 = NULL; /* object token of obj_id */ H5VL_object_t *vol_obj2 = NULL; /* object token of new_loc_id */ + H5VL_object_t tmp_vol_obj; /* Temporary object token of */ H5VL_loc_params_t loc_params1; H5VL_loc_params_t loc_params2; H5P_genplist_t *plist; /* Property list pointer */ @@ -383,10 +384,12 @@ H5Olink(hid_t obj_id, hid_t new_loc_id, const char *new_name, hid_t lcpl_id, if(H5P_set(plist, H5VL_PROP_LINK_TARGET_LOC_PARAMS, &loc_params1) < 0) HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't set property value for target id") + /* Construct a temporary VOL object */ + tmp_vol_obj.data = vol_obj2->data; + tmp_vol_obj.plugin = (vol_obj1 != NULL ? vol_obj1->plugin : vol_obj2->plugin); + /* Create a link to the object */ - if(H5VL_link_create(H5VL_LINK_CREATE_HARD, vol_obj2->data, loc_params2, - (vol_obj1 != NULL ? vol_obj1->plugin->cls : vol_obj2->plugin->cls), - lcpl_id, lapl_id, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0) + if(H5VL_link_create(H5VL_LINK_CREATE_HARD, &tmp_vol_obj, loc_params2, lcpl_id, lapl_id, H5P_DATASET_XFER_DEFAULT, H5_REQUEST_NULL) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCREATE, FAIL, "unable to create link") done: |