diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2006-11-08 21:24:41 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2006-11-08 21:24:41 (GMT) |
commit | 89cca34b9763e12a73a86164306d5ffbede28f64 (patch) | |
tree | 1822cc905222f9e4dd557ae4ac0de1608dcd33f5 /tools/lib | |
parent | a9350e86f0a04cc1f6aba59849063d4acfa1be7b (diff) | |
download | hdf5-89cca34b9763e12a73a86164306d5ffbede28f64.zip hdf5-89cca34b9763e12a73a86164306d5ffbede28f64.tar.gz hdf5-89cca34b9763e12a73a86164306d5ffbede28f64.tar.bz2 |
[svn-r12883]
h5dump bug 701. Symptom: The creation of a hardlink pointing to the root group "/" causes h5dump to display it as a link pointing to itself.
Cure: the root group was not being inserted in the table that keeps track of object names and links.
Added a test for this in the test generation program, the creation of a hardlink to the root
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/h5tools_utils.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/tools/lib/h5tools_utils.c b/tools/lib/h5tools_utils.c index c1fa292..3dbafa5 100644 --- a/tools/lib/h5tools_utils.c +++ b/tools/lib/h5tools_utils.c @@ -600,6 +600,26 @@ init_objs(hid_t fid, find_objs_t *info, table_t **group_table, info->type_table = *type_table; info->dset_table = *dset_table; + { + /* add the root group as an object, it may have hard links to it */ + + H5G_stat_t statbuf; + haddr_t objno; /* compact form of object's location */ + char* tmp; + + if(H5Gget_objinfo(fid, "/", FALSE, &statbuf) < 0) + return FAIL; + else + { + objno = (haddr_t)statbuf.objno[0] | ((haddr_t)statbuf.objno[1] << (8 * sizeof(long))); + /* call with an empty string, it appends group separator */ + tmp = build_obj_path_name(info->prefix, ""); + add_obj(info->group_table, objno, tmp, TRUE); + } + } + + + /* Find all shared objects */ return(H5Giterate(fid, "/", NULL, find_objs_cb, (void *)info)); } |