summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2015-09-27 01:28:39 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2015-09-27 01:28:39 (GMT)
commit574ff3980afe62f83660cb2c617154e85ab128fd (patch)
tree1281be3f8a32432ead139af7381426c0a9fe92d5
parentdbdc9c1e2bd319e67659303c4d2b3e4c8eff5b07 (diff)
downloadhdf5-574ff3980afe62f83660cb2c617154e85ab128fd.zip
hdf5-574ff3980afe62f83660cb2c617154e85ab128fd.tar.gz
hdf5-574ff3980afe62f83660cb2c617154e85ab128fd.tar.bz2
[svn-r27885] Description:
Check if the layout has been retrieved before setting it again. Tested on: MacOSX/64 10.10.5 (amazon) w/serial & parallel (h5committest not required on this branch)
-rw-r--r--src/H5Pdcpl.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/H5Pdcpl.c b/src/H5Pdcpl.c
index b1ddff0..f3acfe2 100644
--- a/src/H5Pdcpl.c
+++ b/src/H5Pdcpl.c
@@ -2133,6 +2133,7 @@ H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name,
H5S_t *src_space; /* Source dataset space selection */
H5O_storage_virtual_ent_t *old_list = NULL; /* List pointer previously on property list */
H5O_storage_virtual_ent_t *ent = NULL; /* Convenience pointer to new VDS entry */
+ hbool_t retrieved_layout = FALSE; /* Whether the layout has been retrieved */
hbool_t adding_entry = FALSE; /* Whether we are in the middle of adding an entry */
hbool_t free_list = FALSE; /* Whether to free the list of virtual entries */
herr_t ret_value = SUCCEED; /* Return value */
@@ -2171,6 +2172,7 @@ H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name,
/* Get the current layout */
if(H5P_peek(plist, H5D_CRT_LAYOUT_NAME, &virtual_layout) < 0)
HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, FAIL, "can't get layout")
+ retrieved_layout = TRUE;
/* If the layout was not already virtual, Start with default virtual layout.
* Otherwise, add the mapping to the current list. */
@@ -2254,10 +2256,12 @@ H5Pset_virtual(hid_t dcpl_id, hid_t vspace_id, const char *src_file_name,
done:
/* Set VDS layout information in property list */
/* (Even on faliure, so there's not a mangled layout struct in the list) */
- if(H5P_poke(plist, H5D_CRT_LAYOUT_NAME, &virtual_layout) < 0) {
- HGOTO_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set layout")
- if(old_list != virtual_layout.storage.u.virt.list)
- free_list = TRUE;
+ if(retrieved_layout) {
+ if(H5P_poke(plist, H5D_CRT_LAYOUT_NAME, &virtual_layout) < 0) {
+ HDONE_ERROR(H5E_PLIST, H5E_CANTSET, FAIL, "can't set layout")
+ if(old_list != virtual_layout.storage.u.virt.list)
+ free_list = TRUE;
+ } /* end if */
} /* end if */
/* Check if the entry has been partly allocated but not added to the