summaryrefslogtreecommitdiffstats
path: root/src/H5Adeprec.c
diff options
context:
space:
mode:
authorMohamad Chaarawi <chaarawi@hdfgroup.org>2014-07-22 19:54:51 (GMT)
committerMohamad Chaarawi <chaarawi@hdfgroup.org>2014-07-22 19:54:51 (GMT)
commitbd66cdd5d6b46ddb9b275903baffcbeaaff65204 (patch)
tree187bff833fc4922687fd825e52e8f9f50b615212 /src/H5Adeprec.c
parentf1f7b15e506820107054bf5e867c3c02686d5c6c (diff)
downloadhdf5-bd66cdd5d6b46ddb9b275903baffcbeaaff65204.zip
hdf5-bd66cdd5d6b46ddb9b275903baffcbeaaff65204.tar.gz
hdf5-bd66cdd5d6b46ddb9b275903baffcbeaaff65204.tar.bz2
[svn-r25468] some code refactoring to align trunk with VOL branch.
tested with h5committest.
Diffstat (limited to 'src/H5Adeprec.c')
-rw-r--r--src/H5Adeprec.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/H5Adeprec.c b/src/H5Adeprec.c
index 6194150..6342e18 100644
--- a/src/H5Adeprec.c
+++ b/src/H5Adeprec.c
@@ -162,6 +162,7 @@ hid_t
H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
hid_t plist_id)
{
+ H5A_t *attr = NULL; /* Attribute created */
H5G_loc_t loc; /* Object location */
H5T_t *type; /* Datatype to use for attribute */
H5S_t *space; /* Dataspace to use for attribute */
@@ -185,9 +186,13 @@ H5Acreate1(hid_t loc_id, const char *name, hid_t type_id, hid_t space_id,
HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataspace")
/* Go do the real work for attaching the attribute to the dataset */
- if((ret_value = H5A_create(&loc, name, type, space, plist_id, H5AC_dxpl_id)) < 0)
+ if((attr = H5A_create(&loc, name, type, space, plist_id, H5AC_dxpl_id)) < 0)
HGOTO_ERROR(H5E_ATTR, H5E_CANTINIT, FAIL, "unable to create attribute")
+ /* Register the new attribute and get an ID for it */
+ if((ret_value = H5I_register(H5I_ATTR, attr, TRUE)) < 0)
+ HGOTO_ERROR(H5E_ATOM, H5E_CANTREGISTER, FAIL, "unable to register attribute for ID")
+
done:
FUNC_LEAVE_API(ret_value)
} /* H5Acreate1() */