diff options
Diffstat (limited to 'src/H5Tprecis.c')
-rw-r--r-- | src/H5Tprecis.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/H5Tprecis.c b/src/H5Tprecis.c index b3975af..6725165 100644 --- a/src/H5Tprecis.c +++ b/src/H5Tprecis.c @@ -174,12 +174,14 @@ H5Tset_precision(hid_t type_id, size_t prec) FUNC_ENTER_API(FAIL) H5TRACE2("e", "iz", type_id, prec); - + /* Check args */ 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) |