summaryrefslogtreecommitdiffstats
path: root/src/H5Aint.c
diff options
context:
space:
mode:
authorVailin Choi <vchoi@hdfgroup.org>2016-07-04 04:06:34 (GMT)
committerVailin Choi <vchoi@hdfgroup.org>2016-07-04 04:06:34 (GMT)
commitaf0829aa171bddb63fa67ee7f7470e661815c24d (patch)
treecc8972cb23f3b1a4bab55317e8974cdf3af67c1f /src/H5Aint.c
parent4f967d5029cd8e0080f5637efd403842394f87d0 (diff)
downloadhdf5-af0829aa171bddb63fa67ee7f7470e661815c24d.zip
hdf5-af0829aa171bddb63fa67ee7f7470e661815c24d.tar.gz
hdf5-af0829aa171bddb63fa67ee7f7470e661815c24d.tar.bz2
[svn-r30143] Fix for HDFFV-9940.
Tested on jam, osx1010test, moohan, platypus, emu, kite, kituo, mayll, ostrich, quail.
Diffstat (limited to 'src/H5Aint.c')
-rw-r--r--src/H5Aint.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/H5Aint.c b/src/H5Aint.c
index ffb8667..2730b0b 100644
--- a/src/H5Aint.c
+++ b/src/H5Aint.c
@@ -202,6 +202,11 @@ H5A_create(const H5G_loc_t *loc, const char *name, const H5T_t *type,
if(NULL == (attr->shared->dt = H5T_copy(type, H5T_COPY_ALL)))
HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "can't get shared datatype info")
+ /* Convert a datatype (if committed) to a transient type if the committed datatype's file
+ location is different from the file location where the attribute will be created */
+ if(H5T_convert_committed_datatype(attr->shared->dt, loc->oloc->file) < 0)
+ HGOTO_ERROR(H5E_ATTR, H5E_CANTGET, NULL, "can't get shared datatype info")
+
/* Mark datatype as being on disk now */
if(H5T_set_loc(attr->shared->dt, loc->oloc->file, H5T_LOC_DISK) < 0)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, NULL, "invalid datatype location")