summaryrefslogtreecommitdiffstats
path: root/src/H5Ocopy.c
diff options
context:
space:
mode:
authorJames Laird <jlaird@hdfgroup.org>2007-01-24 19:01:48 (GMT)
committerJames Laird <jlaird@hdfgroup.org>2007-01-24 19:01:48 (GMT)
commitcdcd2cecf2efae22173c4a26e5ee587c04303a9f (patch)
tree2f63d08ba61d22c148bf34186b6df5a327e8a41f /src/H5Ocopy.c
parent0ab3725051f24fede655d054e3ee0868dcfa7782 (diff)
downloadhdf5-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/H5Ocopy.c')
-rw-r--r--src/H5Ocopy.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c
index d4a0aec..f88e9cf 100644
--- a/src/H5Ocopy.c
+++ b/src/H5Ocopy.c
@@ -585,12 +585,12 @@ H5O_copy_header_real(const H5O_loc_t *oloc_src, H5O_loc_t *oloc_dst /*out */,
current_pos = oh_dst->chunk[0].image;
- /* Copy the header. Most of this (number of messages, etc.) will be
- * overwritten when the header is flushed to disk, but later versions have
- * a magic number that isn't.
+ /* Write the magic number for versions > 1 and skip the rest of the
+ * header. This will be written when the header is flushed to disk.
*/
- HDmemcpy(current_pos, oh_src->chunk[0].image,
- (size_t)(H5O_SIZEOF_HDR(oh_dst) - H5O_SIZEOF_CHKSUM_OH(oh_dst)));
+ if(oh_dst->version > H5O_VERSION_1)
+ HDmemcpy(current_pos, H5O_HDR_MAGIC, H5O_SIZEOF_MAGIC);
+
current_pos += H5O_SIZEOF_HDR(oh_dst) - H5O_SIZEOF_CHKSUM_OH(oh_dst);
/* Copy each message that wasn't dirtied above */