summaryrefslogtreecommitdiffstats
path: root/src/H5D.c
diff options
context:
space:
mode:
authorPedro Vicente Nunes <pvn@hdfgroup.org>2008-12-01 18:46:07 (GMT)
committerPedro Vicente Nunes <pvn@hdfgroup.org>2008-12-01 18:46:07 (GMT)
commite004bd48f2ab7f6b1c3658b5fdc7fe5a6ebeada6 (patch)
tree0d269cc9cf2a3e24d4aeb3b149a645eb42245db4 /src/H5D.c
parent150d4cf4bbdd8e084264da4b73fe4fc40fa93e5c (diff)
downloadhdf5-e004bd48f2ab7f6b1c3658b5fdc7fe5a6ebeada6.zip
hdf5-e004bd48f2ab7f6b1c3658b5fdc7fe5a6ebeada6.tar.gz
hdf5-e004bd48f2ab7f6b1c3658b5fdc7fe5a6ebeada6.tar.bz2
[svn-r16142] Added a check to H5Dset_extent for the space to be chunked, exit with error otherwise
A call to H5Dset_extent in the external test was removed Tested: windows, linux
Diffstat (limited to 'src/H5D.c')
-rw-r--r--src/H5D.c19
1 files changed, 11 insertions, 8 deletions
diff --git a/src/H5D.c b/src/H5D.c
index 516103d..699ec9a 100644
--- a/src/H5D.c
+++ b/src/H5D.c
@@ -1069,21 +1069,24 @@ H5Dset_extent(hid_t dset_id, const hsize_t size[])
{
H5D_t *dset; /* Dataset for this operation */
herr_t ret_value = SUCCEED; /* Return value */
-
+
FUNC_ENTER_API(H5Dset_extent, FAIL)
H5TRACE2("e", "i*h", dset_id, size);
-
+
/* Check args */
if(NULL == (dset = (H5D_t *)H5I_object_verify(dset_id, H5I_DATASET)))
- HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset")
+ HGOTO_ERROR(H5E_ARGS, H5E_BADTYPE, FAIL, "not a dataset")
if(!size)
- HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no size specified")
-
+ HGOTO_ERROR(H5E_ARGS, H5E_BADVALUE, FAIL, "no size specified")
+ /* layout must be chunked */
+ if(H5D_CHUNKED != dset->shared->layout.type)
+ HGOTO_ERROR(H5E_DATASET, H5E_BADSELECT, FAIL, "layout must be chunked")
+
/* Private function */
if(H5D_set_extent(dset, size, H5AC_dxpl_id) < 0)
- HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set extend dataset")
-
+ HGOTO_ERROR(H5E_DATASET, H5E_CANTINIT, FAIL, "unable to set extend dataset")
+
done:
- FUNC_LEAVE_API(ret_value)
+ FUNC_LEAVE_API(ret_value)
} /* end H5Dset_extent() */