diff options
author | Raymond Lu <songyulu@hdfgroup.org> | 2004-06-22 21:51:41 (GMT) |
---|---|---|
committer | Raymond Lu <songyulu@hdfgroup.org> | 2004-06-22 21:51:41 (GMT) |
commit | da4021c41dd3ac8dd7a23de3e8a0825b610d2795 (patch) | |
tree | 4da651bfdd3821b275475cc6f6c4f27858ea5fe4 /src | |
parent | bb5ed44dd66cf79f972b18ca2a2ae271d1e00801 (diff) | |
download | hdf5-da4021c41dd3ac8dd7a23de3e8a0825b610d2795.zip hdf5-da4021c41dd3ac8dd7a23de3e8a0825b610d2795.tar.gz hdf5-da4021c41dd3ac8dd7a23de3e8a0825b610d2795.tar.bz2 |
[svn-r8723] Purpose: Bug fix and test.
Description: Function H5Gget_objtype_by_idx failed to handle soft link
object. The library returned object type by calling H5G_get_type through
H5B_iterate. But H5G_get_type only deals with objects with valid header
address which soft link doesn't have.
Solution: In H5G_node_type, make soft link a special case by checking if
the object type is H5G_CACHED_SLINK. Also added a test of soft and hard links
to titerate.c
Platforms tested: eirene and copper(tested h5committest for v1.7)
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Gnode.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 672cd31..abd6116 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -1448,7 +1448,16 @@ H5G_node_type(H5F_t *f, hid_t dxpl_id, void UNUSED *_lt_key, haddr_t addr, if(bt_udata->idx >= bt_udata->num_objs && bt_udata->idx < (bt_udata->num_objs+sn->nsyms)) { loc_idx = bt_udata->idx - bt_udata->num_objs; - bt_udata->type = H5G_get_type(&(sn->entry[loc_idx]), dxpl_id); + + /* Since H5G_get_type has to use header address in table entry and the + * header address for soft link is HADDR_UNDEF, make a special case for + * soft link here. + */ + if(sn->entry[loc_idx].type == H5G_CACHED_SLINK) + bt_udata->type = H5G_LINK; + else + bt_udata->type = H5G_get_type(&(sn->entry[loc_idx]), dxpl_id); + HGOTO_DONE(H5B_ITER_STOP); } |