summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorNeil Fortner <nfortne2@hdfgroup.org>2015-04-02 19:17:42 (GMT)
committerNeil Fortner <nfortne2@hdfgroup.org>2015-04-02 19:17:42 (GMT)
commit3e0eae188b28136ca7981ffcabeb41bae97c1bea (patch)
tree8c685916f350bb49df8d42c9efbc23dd82048280 /src
parentbe81aef60fc799b47aec3258d5d6caea8ee510ad (diff)
downloadhdf5-3e0eae188b28136ca7981ffcabeb41bae97c1bea.zip
hdf5-3e0eae188b28136ca7981ffcabeb41bae97c1bea.tar.gz
hdf5-3e0eae188b28136ca7981ffcabeb41bae97c1bea.tar.bz2
[svn-r26709] Port r26690 from trunk to 1.8 branch.
Tested: jam, koala, ostrich (h5committest) Log from 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')
-rw-r--r--src/H5S.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/H5S.c b/src/H5S.c
index 88af6e0..f687476 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() */