diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2005-12-26 05:28:18 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2005-12-26 05:28:18 (GMT) |
commit | 83929ea716220890e41f923566aa5c89e8e735d3 (patch) | |
tree | 22193da0d9129fc7c06a57db35b2f4a57458cf50 /src/H5T.c | |
parent | db551ec15e771b4536c35cc6f3eabb7d28681510 (diff) | |
download | hdf5-83929ea716220890e41f923566aa5c89e8e735d3.zip hdf5-83929ea716220890e41f923566aa5c89e8e735d3.tar.gz hdf5-83929ea716220890e41f923566aa5c89e8e735d3.tar.bz2 |
[svn-r11838] Purpose:
Bug fix
Description:
Retrieving an object's name could fail (in various ways) under certain
circumstances (mostly having to do with mounted files).
Solution:
Re-write & simplify "get object name" code to fix error in a better way
than adding yet another hack to the previous pile of hacks... :-)
Platforms tested:
FreeBSD 4.11 (sleipnir)
h5committest
Diffstat (limited to 'src/H5T.c')
-rw-r--r-- | src/H5T.c | 13 |
1 files changed, 11 insertions, 2 deletions
@@ -3209,9 +3209,18 @@ H5T_copy(const H5T_t *old_dt, H5T_copy_t method) if(new_dt->shared->state == H5T_STATE_NAMED || new_dt->shared->state == H5T_STATE_OPEN) { if(!H5F_addr_defined(old_dt->oloc.addr)) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, NULL, "named dataype with invalid address") - if(H5O_loc_copy(&(new_dt->oloc), &(old_dt->oloc), H5O_COPY_DEEP) < 0) +#if defined(H5_USING_PURIFY) || !defined(NDEBUG) + /* Clear object location */ + if(H5O_loc_reset(&(new_dt->oloc)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, NULL, "unable to reset location") + + /* Clear path name */ + if(H5G_name_reset(&(new_dt->path)) < 0) + HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, NULL, "unable to reset path") +#endif /* H5_USING_PURIFY */ + if(H5O_loc_copy(&(new_dt->oloc), &(old_dt->oloc), H5_COPY_DEEP) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, NULL, "unable to copy entry") - if(H5G_name_copy(&(new_dt->path), &(old_dt->path), H5G_COPY_DEEP) < 0) + if(H5G_name_copy(&(new_dt->path), &(old_dt->path), H5_COPY_DEEP) < 0) HGOTO_ERROR(H5E_SYM, H5E_CANTOPENOBJ, NULL, "unable to copy path") } /* end if */ else { |