summaryrefslogtreecommitdiffstats
path: root/tools/h5repack/h5repack_refs.c
diff options
context:
space:
mode:
authorJonathan Kim <jkm@hdfgroup.org>2010-03-18 21:38:09 (GMT)
committerJonathan Kim <jkm@hdfgroup.org>2010-03-18 21:38:09 (GMT)
commit8c9b42fcf3d5077414e860e701d53bf61d0d99cd (patch)
tree7538f5eb2d9ccfb10beec1e57ff0d7b85c6cb13a /tools/h5repack/h5repack_refs.c
parentbcd6c3f7cca0b5cb888132f8d24230c15d03d5d0 (diff)
downloadhdf5-8c9b42fcf3d5077414e860e701d53bf61d0d99cd.zip
hdf5-8c9b42fcf3d5077414e860e701d53bf61d0d99cd.tar.gz
hdf5-8c9b42fcf3d5077414e860e701d53bf61d0d99cd.tar.bz2
[svn-r18425] Purpose:
Fix for bug1814 - NPOESS: h5repack doesn't handle references to the groups as an element of a dataset Description: handles object reference to named-datatype as well. Add test cases. Tested: jam, amani, linew
Diffstat (limited to 'tools/h5repack/h5repack_refs.c')
-rw-r--r--tools/h5repack/h5repack_refs.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/tools/h5repack/h5repack_refs.c b/tools/h5repack/h5repack_refs.c
index fddcf0e..9945f49 100644
--- a/tools/h5repack/h5repack_refs.c
+++ b/tools/h5repack/h5repack_refs.c
@@ -690,23 +690,31 @@ static const char* MapIdToName(hid_t refobj_id,
trav_table_t *travt)
{
unsigned int i;
+ const char* ret = NULL;
+ H5O_info_t ref_oinfo; /* Stat for the refobj id */
/* linear search */
for(i = 0; i < travt->nobjs; i++)
{
- if(travt->objs[i].type == H5O_TYPE_DATASET)
+ if(travt->objs[i].type == H5O_TYPE_DATASET ||
+ travt->objs[i].type == H5O_TYPE_GROUP ||
+ travt->objs[i].type == H5O_TYPE_NAMED_DATATYPE)
{
H5O_info_t ref_oinfo; /* Stat for the refobj id */
/* obtain information to identify the referenced object uniquely */
if(H5Oget_info(refobj_id, &ref_oinfo) < 0)
- return NULL;
+ goto out;
if(ref_oinfo.addr == travt->objs[i].objno)
- return(travt->objs[i].name);
+ {
+ ret = travt->objs[i].name;
+ goto out;
+ }
} /* end if */
} /* i */
- return NULL;
+out:
+ return ret;
}