diff options
author | Vailin Choi <vchoi@hdfgroup.org> | 2016-07-04 04:06:34 (GMT) |
---|---|---|
committer | Vailin Choi <vchoi@hdfgroup.org> | 2016-07-04 04:06:34 (GMT) |
commit | af0829aa171bddb63fa67ee7f7470e661815c24d (patch) | |
tree | cc8972cb23f3b1a4bab55317e8974cdf3af67c1f /src/H5T.c | |
parent | 4f967d5029cd8e0080f5637efd403842394f87d0 (diff) | |
download | hdf5-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/H5T.c')
-rw-r--r-- | src/H5T.c | 43 |
1 files changed, 43 insertions, 0 deletions
@@ -5003,6 +5003,49 @@ done: FUNC_LEAVE_NOAPI(ret_value) } +/*------------------------------------------------------------------------- + * Function: H5T_convert_committed_datatype + * + * Purpose: To convert the committed datatype "dt" to a transient embedded + * type if the file location associated with the committed datatype is + * different from the parameter "f". + * "f" is the file location where the dataset or attribute will be created. + * + * Notes: See HDFFV-9940 + * + * Return: Success: non-negative + * Failure: negative + * + * Programmer: Vailin Choi; June 2016 + * + *------------------------------------------------------------------------- + */ +herr_t +H5T_convert_committed_datatype(H5T_t *dt, H5F_t *f) +{ + herr_t ret_value = SUCCEED; /* Return value */ + + FUNC_ENTER_NOAPI(FAIL) + + HDassert(dt); + HDassert(f); + + if(H5T_is_named(dt) && (dt->sh_loc.file != f)) { + HDassert(dt->sh_loc.type == H5O_SHARE_TYPE_COMMITTED); + + H5O_msg_reset_share(H5O_DTYPE_ID, dt); + if(H5O_loc_free(&dt->oloc) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTRESET, FAIL, "unable to initialize location") + if(H5G_name_free(&dt->path) < 0) + HGOTO_ERROR(H5E_DATATYPE, H5E_CANTOPENOBJ, FAIL, "unable to reset path") + + dt->shared->state = H5T_STATE_TRANSIENT; + } + +done: + FUNC_LEAVE_NOAPI(ret_value) +} /* end H5T_convert_committed_datatype() */ + /*-------------------------------------------------------------------------- NAME |