From b87dc8724908278a90c7ac804e49b924207cb3af Mon Sep 17 00:00:00 2001 From: Raymond Lu Date: Tue, 22 Jun 2004 16:08:10 -0500 Subject: [svn-r8721] 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: h5committest and RH 8(fuss). --- src/H5Gnode.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/H5Gnode.c b/src/H5Gnode.c index 09d90da..71a1f1a 100644 --- a/src/H5Gnode.c +++ b/src/H5Gnode.c @@ -1630,7 +1630,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); + ret_value = H5B_ITER_STOP; } else { bt_udata->num_objs += sn->nsyms; -- cgit v0.12