diff options
Diffstat (limited to 'tools/src/h5repack')
-rw-r--r-- | tools/src/h5repack/CMakeLists.txt | 2 | ||||
-rw-r--r-- | tools/src/h5repack/h5repack_refs.c | 9 |
2 files changed, 9 insertions, 2 deletions
diff --git a/tools/src/h5repack/CMakeLists.txt b/tools/src/h5repack/CMakeLists.txt index 4a1430e..967e8d7 100644 --- a/tools/src/h5repack/CMakeLists.txt +++ b/tools/src/h5repack/CMakeLists.txt @@ -1,4 +1,4 @@ -cmake_minimum_required (VERSION 3.10) +cmake_minimum_required (VERSION 3.12) project (HDF5_TOOLS_SRC_H5REPACK C) # -------------------------------------------------------------------- diff --git a/tools/src/h5repack/h5repack_refs.c b/tools/src/h5repack/h5repack_refs.c index e6a747d..2685823 100644 --- a/tools/src/h5repack/h5repack_refs.c +++ b/tools/src/h5repack/h5repack_refs.c @@ -530,9 +530,16 @@ static int copy_refs_attr(hid_t loc_in, ref_comp_size = NULL; } } + /* This line below needs to be moved in this loop instead of inserting outside. Otherwise, + ref_comp_field_n may be >0 for the next attribute, which may not be + the reference type and will be accidently treated as the reference type. + It will then cause the H5Acreate2 failed since that attribute is already created. + KY 2020-02-07 + */ + is_ref_comp = (ref_comp_field_n > 0); + } - is_ref_comp = (ref_comp_field_n > 0); if (!(is_ref || is_ref_vlen || is_ref_array || is_ref_comp)) { if (H5Tclose(mtype_id) < 0) |