[svn-r17751] Purpose: Fix assertion failure caused by H5Tcommit1/2

Description:
Calling H5Tcommit1 or H5Tcommit2 on a file with read only access would cause an
assertion failure.  Added a check to H5T_commit_named to return a failure in
this case.  Also a minor fix in the link_filters test.

Tested: Fedora 11 (very minor change)
This commit is contained in:
Neil Fortner
2009-10-27 15:56:54 -05:00
parent ab3f3e0219
commit 34c8292e76
3 changed files with 47 additions and 4 deletions

View File

@@ -199,6 +199,10 @@ H5T_commit_named(const H5G_loc_t *loc, const char *name, H5T_t *dt,
HDassert(tapl_id != H5P_DEFAULT);
HDassert(dxpl_id != H5P_DEFAULT);
/* Check if we are allowed to write to this file */
if(0 == (H5F_INTENT(loc->oloc->file) & H5F_ACC_RDWR))
HGOTO_ERROR(H5E_DATATYPE, H5E_WRITEERROR, FAIL, "no write intent on file")
/* Record the type's state so that we can revert to it if linking fails */
old_state = dt->shared->state;