diff options
author | Quincey Koziol <koziol@hdfgroup.org> | 2015-10-04 03:58:55 (GMT) |
---|---|---|
committer | Quincey Koziol <koziol@hdfgroup.org> | 2015-10-04 03:58:55 (GMT) |
commit | 0ee053bb95a620b6f8109d22a372f6acc1cee300 (patch) | |
tree | b14937bd8504e501bac58e5af4201a5b74cbec17 /src | |
parent | 47c5bc7d61f11e2f6635a1c6a52d8ae56081758d (diff) | |
download | hdf5-0ee053bb95a620b6f8109d22a372f6acc1cee300.zip hdf5-0ee053bb95a620b6f8109d22a372f6acc1cee300.tar.gz hdf5-0ee053bb95a620b6f8109d22a372f6acc1cee300.tar.bz2 |
[svn-r27944] Description:
Avoid duplicating source FAPL & DAPL if they are already available.
Tested on:
MacOSX/64 10.10.5 (amazon) w/serial & parallel
(h5committest not required on this branch)
Diffstat (limited to 'src')
-rw-r--r-- | src/H5Dvirtual.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/src/H5Dvirtual.c b/src/H5Dvirtual.c index af9963d..cbd9e35 100644 --- a/src/H5Dvirtual.c +++ b/src/H5Dvirtual.c @@ -615,12 +615,16 @@ H5D__virtual_reset_layout(H5O_layout_t *layout) (void)HDmemset(layout->storage.u.virt.min_dims, 0, sizeof(layout->storage.u.virt.min_dims)); /* Close access property lists */ - if(layout->storage.u.virt.source_fapl >= 0) + if(layout->storage.u.virt.source_fapl >= 0) { if(H5I_dec_ref(layout->storage.u.virt.source_fapl) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't close source fapl") - if(layout->storage.u.virt.source_dapl >= 0) + layout->storage.u.virt.source_fapl = -1; + } /* end if */ + if(layout->storage.u.virt.source_dapl >= 0) { if(H5I_dec_ref(layout->storage.u.virt.source_dapl) < 0) HDONE_ERROR(H5E_DATASET, H5E_CANTFREE, FAIL, "can't close source dapl") + layout->storage.u.virt.source_dapl = -1; + } /* end if */ /* The list is no longer initialized */ layout->storage.u.virt.init = FALSE; @@ -2013,12 +2017,14 @@ H5D__virtual_init(H5F_t *f, hid_t H5_ATTR_UNUSED dxpl_id, const H5D_t *dset, storage->printf_gap = (hsize_t)0; /* Retrieve VDS file FAPL to layout */ - if((storage->source_fapl = H5F_get_access_plist(f, FALSE)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get fapl") + if(storage->source_fapl <= 0) + if((storage->source_fapl = H5F_get_access_plist(f, FALSE)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTGET, FAIL, "can't get fapl") /* Copy DAPL to layout */ - if((storage->source_dapl = H5P_copy_plist(dapl, FALSE)) < 0) - HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy dapl") + if(storage->source_dapl <= 0) + if((storage->source_dapl = H5P_copy_plist(dapl, FALSE)) < 0) + HGOTO_ERROR(H5E_DATASET, H5E_CANTCOPY, FAIL, "can't copy dapl") /* Mark layout as not fully initialized (must be done prior to I/O for * unlimited/printf selections) */ |