summaryrefslogtreecommitdiffstats
path: root/src/H5Torder.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2009-01-27 15:56:48 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2009-01-27 15:56:48 (GMT)
commitbf4789092a2a63d8418677e66410a7cbee665fa5 (patch)
tree859103103d2d56da3dcc3cdfc6bdb8d26c601c45 /src/H5Torder.c
parenta6dcbd6a0ffbc17179b83e0910aca3e78b9b706a (diff)
downloadhdf5-bf4789092a2a63d8418677e66410a7cbee665fa5.zip
hdf5-bf4789092a2a63d8418677e66410a7cbee665fa5.tar.gz
hdf5-bf4789092a2a63d8418677e66410a7cbee665fa5.tar.bz2
[svn-r16360] Purpose: Fix potential error with H5Tset_order
Description: H5Tset_order will now properly reject H5T_ORDER_NONE for most datatypes. Previously this could cause major problems as the file could not be flushed. Tested: jam, smirom (h5committest)
Diffstat (limited to 'src/H5Torder.c')
-rw-r--r--src/H5Torder.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/H5Torder.c b/src/H5Torder.c
index 34dbd8e..6c0667b 100644
--- a/src/H5Torder.c
+++ b/src/H5Torder.c
@@ -158,6 +158,8 @@ H5Tset_order(hid_t type_id, H5T_order_t order)
HGOTO_ERROR(H5E_DATATYPE, H5E_CANTINIT, FAIL, "operation not allowed after members are defined")
while (dt->shared->parent)
dt = dt->shared->parent; /*defer to parent*/
+ if (order == H5T_ORDER_NONE && !(H5T_REFERENCE == dt->shared->type || H5T_IS_FIXED_STRING(dt->shared)))
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "illegal byte order")
if (!H5T_IS_ATOMIC(dt->shared))
HGOTO_ERROR(H5E_DATATYPE, H5E_UNSUPPORTED, FAIL, "operation not defined for specified datatype")