summaryrefslogtreecommitdiffstats
path: root/src/H5S.c
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2015-04-01 14:22:16 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2015-04-01 14:22:16 (GMT)
commitb31a086f3ec5dce6ac995235864e3e1777066409 (patch)
tree96a27d8a0689f9393c07e79fd9e2cc876eed6429 /src/H5S.c
parentd28652dacf3d9f3703dc16f919049c452a2f5e09 (diff)
downloadhdf5-b31a086f3ec5dce6ac995235864e3e1777066409.zip
hdf5-b31a086f3ec5dce6ac995235864e3e1777066409.tar.gz
hdf5-b31a086f3ec5dce6ac995235864e3e1777066409.tar.bz2
[svn-r26690] Fix error in H5Sextent_copy
When the selection is set to all, H5Sextent_copy did not update the number of elements in the selection in the destination space. Fixed H5Sextent_copy to do this. Added tests for this functionality. Tested: jam, koala, ostrich (h5committest)
Diffstat (limited to 'src/H5S.c')
-rw-r--r--src/H5S.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/H5S.c b/src/H5S.c
index a9812695..4a1783e 100644
--- a/src/H5S.c
+++ b/src/H5S.c
@@ -482,6 +482,12 @@ H5Sextent_copy(hid_t dst_id,hid_t src_id)
if(H5S_extent_copy(&(dst->extent), &(src->extent), TRUE) < 0)
HGOTO_ERROR(H5E_DATASPACE, H5E_CANTCOPY, FAIL, "can't copy extent")
+ /* If the selection is 'all', update the number of elements selected in the
+ * destination space */
+ if(H5S_SEL_ALL == H5S_GET_SELECT_TYPE(dst))
+ if(H5S_select_all(dst, FALSE) < 0)
+ HGOTO_ERROR(H5E_DATASPACE, H5E_CANTDELETE, FAIL, "can't change selection")
+
done:
FUNC_LEAVE_API(ret_value)
} /* end H5Sextent_copy() */