diff options
author | Jonathan Kim <jkm@hdfgroup.org> | 2010-03-18 22:31:00 (GMT) |
---|---|---|
committer | Jonathan Kim <jkm@hdfgroup.org> | 2010-03-18 22:31:00 (GMT) |
commit | 8438c335ede908a851ef783f1fd0a0a0d4cf821d (patch) | |
tree | b1499f45fb4f724a778a4b89501495d1d1acf1a4 /tools/h5repack/h5repack_refs.c | |
parent | a8bd5d03e9f876f9d2144228a5140798c5aee04c (diff) | |
download | hdf5-8438c335ede908a851ef783f1fd0a0a0d4cf821d.zip hdf5-8438c335ede908a851ef783f1fd0a0a0d4cf821d.tar.gz hdf5-8438c335ede908a851ef783f1fd0a0a0d4cf821d.tar.bz2 |
[svn-r18427] Purpose:
Fix for bug1814 - NPOESS: h5repack doesn't handle references to the groups
as an element of a dataset
Description:
Merged from hdf5 trunk r18425
handles object reference to named-datatype as well.
Add test cases.
Tested:
jam
Diffstat (limited to 'tools/h5repack/h5repack_refs.c')
-rw-r--r-- | tools/h5repack/h5repack_refs.c | 16 |
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; } |