summaryrefslogtreecommitdiffstats
path: root/src/H5Ocopy.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2016-04-04 22:22:56 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2016-04-04 22:22:56 (GMT)
commitc7d495163419f785a2fe5237991c4ab6e6286091 (patch)
treece2bf91d97d9a9290680b4a80295fe1aa1ec5f70 /src/H5Ocopy.c
parent2221a9a96e1fc06290ba0bf2e68f9489f071483e (diff)
downloadhdf5-c7d495163419f785a2fe5237991c4ab6e6286091.zip
hdf5-c7d495163419f785a2fe5237991c4ab6e6286091.tar.gz
hdf5-c7d495163419f785a2fe5237991c4ab6e6286091.tar.bz2
[svn-r29626] Description:
Revise method of invoking object flush callback. Tested on: MacOSX/64 10.11.4 (amazon) w/serial & parallel (h5committest forthcoming)
Diffstat (limited to 'src/H5Ocopy.c')
-rw-r--r--src/H5Ocopy.c19
1 files changed, 16 insertions, 3 deletions
diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c
index 936c8b8..0ee8cfd 100644
--- a/src/H5Ocopy.c
+++ b/src/H5Ocopy.c
@@ -354,17 +354,30 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out*/,
H5G_loc_t tmp_loc; /* Location of object */
H5O_loc_t tmp_oloc; /* Location of object */
H5G_name_t tmp_path; /* Object's path */
+ void *obj_ptr = NULL; /* Object pointer */
+ hid_t tmp_id = -1; /* Object ID */
tmp_loc.oloc = &tmp_oloc;
tmp_loc.path = &tmp_path;
tmp_oloc.file = oloc_src->file;
tmp_oloc.addr = oloc_src->addr;
- tmp_oloc.holding_file = oloc_src->holding_file;
+ tmp_oloc.holding_file = FALSE;
H5G_name_reset(tmp_loc.path);
- /* Flush the object of this class */
- if(obj_class->flush && obj_class->flush(&tmp_loc, dxpl_id) < 0)
+ /* Get a temporary ID */
+ if((tmp_id = obj_class->open(&tmp_loc, H5P_DEFAULT, dxpl_id, FALSE)) < 0)
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to open object")
+
+ /* Get object pointer */
+ obj_ptr = H5I_object(tmp_id);
+
+ /* Flush the object */
+ if(obj_class->flush && obj_class->flush(obj_ptr, dxpl_id) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTFLUSH, FAIL, "unable to flush object")
+
+ /* Release the temporary ID */
+ if(tmp_id != -1 && H5I_dec_app_ref(tmp_id))
+ HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "unable to close temporary ID")
} /* end if */
/* Get source object header */