diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2007-01-31 01:48:28 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2007-01-31 01:48:28 (GMT) |
commit | f555ac654b71f0bcaab99775f8c2fe1dac26bfab (patch) | |
tree | 4373fd37a09817506dffc1df8940a5c6cb45110c /src/H5A.c | |
parent | 077369969266846a92701bc7296749707db6d8f2 (diff) | |
download | hdf5-f555ac654b71f0bcaab99775f8c2fe1dac26bfab.zip hdf5-f555ac654b71f0bcaab99775f8c2fe1dac26bfab.tar.gz hdf5-f555ac654b71f0bcaab99775f8c2fe1dac26bfab.tar.bz2 |
[svn-r13226] Description:
Add attributes to the message classes that use the shared message
method calling interface, completing the transition. The other mechanism will
be removed shortly.
Tested on:
Mac OS X/32 10.4.8 (amazon)
FreeBSD/32 6.2 (duty)
Diffstat (limited to 'src/H5A.c')
-rw-r--r-- | src/H5A.c | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -359,12 +359,10 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type, HGOTO_ERROR(H5E_ATTR, H5E_CANTOPENOBJ, FAIL, "unable to copy path") /* Check if any of the pieces should be (or are already) shared in the - * SOHM table */ - /* Data type */ + * SOHM table + */ if(H5SM_try_share(attr->oloc.file, dxpl_id, H5O_DTYPE_ID, attr->dt) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "trying to share datatype failed") - - /* Data space */ if(H5SM_try_share(attr->oloc.file, dxpl_id, H5O_SDSPACE_ID, attr->ds) < 0) HGOTO_ERROR(H5E_OHDR, H5E_BADMESG, FAIL, "trying to share dataspace failed") @@ -1302,9 +1300,11 @@ H5Arename(hid_t loc_id, const char *old_name, const char *new_name) if(H5G_loc(loc_id, & loc) < 0) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a location") - /* Call attribute rename routine */ - if(H5O_attr_rename(loc.oloc, H5AC_dxpl_id, old_name, new_name) < 0) - HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute") + /* Avoid thrashing things if the names are the same */ + if(HDstrcmp(old_name, new_name)) + /* Call attribute rename routine */ + if(H5O_attr_rename(loc.oloc, H5AC_dxpl_id, old_name, new_name) < 0) + HGOTO_ERROR(H5E_ATTR, H5E_CANTRENAME, FAIL, "can't rename attribute") done: FUNC_LEAVE_API(ret_value) |