diff options
Diffstat (limited to 'src/H5Tprecis.c')
-rw-r--r-- | src/H5Tprecis.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/H5Tprecis.c b/src/H5Tprecis.c index b3975af..6a51bab 100644 --- a/src/H5Tprecis.c +++ b/src/H5Tprecis.c @@ -179,7 +179,9 @@ H5Tset_precision(hid_t type_id, size_t prec) if (NULL == (dt = H5I_object_verify(type_id,H5I_DATATYPE))) HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a datatype") if (H5T_STATE_TRANSIENT!=dt->shared->state) - HGOTO_ERROR(H5E_ARGS, H5E_CANTSET, FAIL, "datatype is read-only") + HGOTO_ERROR(H5E_ARGS, H5E_CANTSET, FAIL, "datatype is read-only") + if (NULL != dt->vol_obj) + HGOTO_ERROR(H5E_ARGS, H5E_CANTSET, FAIL, "datatype is committed") if (prec == 0) HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "precision must be positive") if (H5T_ENUM==dt->shared->type && dt->shared->u.enumer.nmembs>0) |