diff options
author | James Laird <jlaird@hdfgroup.org> | 2007-01-24 19:01:48 (GMT) |
---|---|---|
committer | James Laird <jlaird@hdfgroup.org> | 2007-01-24 19:01:48 (GMT) |
commit | cdcd2cecf2efae22173c4a26e5ee587c04303a9f (patch) | |
tree | 2f63d08ba61d22c148bf34186b6df5a327e8a41f /src/H5Oattr.c | |
parent | 0ab3725051f24fede655d054e3ee0868dcfa7782 (diff) | |
download | hdf5-cdcd2cecf2efae22173c4a26e5ee587c04303a9f.zip hdf5-cdcd2cecf2efae22173c4a26e5ee587c04303a9f.tar.gz hdf5-cdcd2cecf2efae22173c4a26e5ee587c04303a9f.tar.bz2 |
[svn-r13187] Fixed another issue with H5Ocopy when attributes had shared datatypes/
dataspaces that became un-shared in the destination.
Tested on Windows, smirom, and kagiso. Need to extend objcopy test so that
it checks that attributes are actually copied successfully.
Diffstat (limited to 'src/H5Oattr.c')
-rw-r--r-- | src/H5Oattr.c | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/src/H5Oattr.c b/src/H5Oattr.c index 35a4785..7ec3217 100644 --- a/src/H5Oattr.c +++ b/src/H5Oattr.c @@ -965,12 +965,27 @@ H5O_attr_copy_file(H5F_t *file_src, const H5O_msg_class_t UNUSED *mesg_type, /* Copy the shared object from source to destination */ if(H5O_copy_header_map(src_oloc, dst_oloc, dxpl_id, cpy_info, FALSE) < 0) HGOTO_ERROR(H5E_OHDR, H5E_CANTCOPY, NULL, "unable to copy object") - } /* end if */ + } else { + /* If the datatype is not named, it may have been shared in the + * source file's heap. Un-share it for now. We'll try to shared + * it in the destination file below. + */ + if(H5O_msg_reset_share(H5O_DTYPE_ID, attr_dst->dt) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to reset datatype sharing") + } + /* end if */ /* Copy the dataspace for the attribute */ attr_dst->ds = H5S_copy(attr_src->ds, FALSE); HDassert(attr_dst->ds); + /* Reset the dataspace's sharing in the source file before trying to share + * it in the destination. + */ + if(H5O_msg_reset_share(H5O_SDSPACE_ID, attr_dst->ds) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTINIT, NULL, "unable to reset dataspace sharing") + + /* Try to share both the datatype and dataset. This does nothing if the * datatype is committed or sharing is disabled. */ |