summaryrefslogtreecommitdiffstats
path: root/src/H5VLnative.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2014-07-23 21:38:44 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2014-07-23 21:38:44 (GMT)
commitad690e7be37389bdb48af7dc08b37bbd3a75aa86 (patch)
tree3d13da365c48a4e432deb367d158c1a3a13c92e1 /src/H5VLnative.c
parent89456ae48793e7063298980277e718491db13813 (diff)
downloadhdf5-ad690e7be37389bdb48af7dc08b37bbd3a75aa86.zip
hdf5-ad690e7be37389bdb48af7dc08b37bbd3a75aa86.tar.gz
hdf5-ad690e7be37389bdb48af7dc08b37bbd3a75aa86.tar.bz2
[svn-r25476] - fix error output in several places.
- uncomment tests to check error output in Makefiles. - fix bug in native implementation of H5Aiterate.
Diffstat (limited to 'src/H5VLnative.c')
-rw-r--r--src/H5VLnative.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/H5VLnative.c b/src/H5VLnative.c
index 4dcd2ba..c26f68b 100644
--- a/src/H5VLnative.c
+++ b/src/H5VLnative.c
@@ -660,6 +660,7 @@ static herr_t H5VL_native_attr_iterate(void *obj, H5VL_loc_params_t loc_params,
hsize_t last_attr; /* Index of last attribute examined */
void *temp_obj = NULL;
H5I_type_t obj_type;
+ H5VL_t *vol_plugin = NULL; /* VOL plugin information */
herr_t ret_value; /* Return value */
FUNC_ENTER_NOAPI_NOINIT
@@ -677,9 +678,15 @@ static herr_t H5VL_native_attr_iterate(void *obj, H5VL_loc_params_t loc_params,
/* Iterate over the links */
if(loc_params.type == H5VL_OBJECT_BY_SELF) {
+ /* Build the vol plugin struct */
+ if(NULL == (vol_plugin = (H5VL_t *)H5MM_calloc(sizeof(H5VL_t))))
+ HGOTO_ERROR(H5E_RESOURCE, H5E_NOSPACE, FAIL, "memory allocation failed")
+ vol_plugin->cls = &H5VL_native_g;
+ vol_plugin->nrefs = 1;
+
/* Get an atom for the object */
- if((obj_loc_id = H5VL_native_register(loc_params.obj_type, obj, TRUE)) < 0)
- HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register object");
+ if((obj_loc_id = H5I_register2(loc_params.obj_type, obj, vol_plugin, TRUE)) < 0)
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register object")
}
else if(loc_params.type == H5VL_OBJECT_BY_NAME) {
/* Set up opened group location to fill in */
@@ -724,7 +731,11 @@ done:
/* Release resources */
if(loc_params.type == H5VL_OBJECT_BY_SELF) {
if(obj_loc_id >= 0 && NULL == H5I_remove(obj_loc_id))
- HDONE_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to open object");
+ HDONE_ERROR(H5E_SYM, H5E_CANTOPENOBJ, FAIL, "unable to free identifier");
+
+ vol_plugin->nrefs--;
+ if(0 == vol_plugin->nrefs)
+ H5MM_free(vol_plugin);
}
else if(loc_params.type == H5VL_OBJECT_BY_NAME) {
if(obj_loc_id >= 0) {