summaryrefslogtreecommitdiffstats
path: root/src/H5Oint.c
diff options
context:
space:
mode:
authorChris Hogan <chogan@hdfgroup.org>2019-10-28 21:24:54 (GMT)
committerChris Hogan <chogan@hdfgroup.org>2019-11-27 15:36:58 (GMT)
commit3aedc32b1c0eb5c883665ce42e07249f106d3403 (patch)
treebaae04b6513ad2ccd177eeebff4da1f1e9241b1b /src/H5Oint.c
parent4c1aca327204b6a30a1568cc5b47bb9e98f09087 (diff)
downloadhdf5-3aedc32b1c0eb5c883665ce42e07249f106d3403.zip
hdf5-3aedc32b1c0eb5c883665ce42e07249f106d3403.tar.gz
hdf5-3aedc32b1c0eb5c883665ce42e07249f106d3403.tar.bz2
Use API context to store/retrieve LCPL and DCPL properties
Adding changes from PR 2029 to 1.12 branch.
Diffstat (limited to 'src/H5Oint.c')
-rw-r--r--src/H5Oint.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/H5Oint.c b/src/H5Oint.c
index f2679fd..de64b49 100644
--- a/src/H5Oint.c
+++ b/src/H5Oint.c
@@ -351,8 +351,18 @@ H5O__create_ohdr(H5F_t *f, hid_t ocpl_id)
HGOTO_ERROR(H5E_PLIST, H5E_BADTYPE, NULL, "not a property list")
/* Get any object header status flags set by properties */
- if(H5P_get(oc_plist, H5O_CRT_OHDR_FLAGS_NAME, &oh_flags) < 0)
- HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get object header flags")
+ if(H5P_DATASET_CREATE_DEFAULT == ocpl_id)
+ {
+ /* If the OCPL is the default DCPL, we can get the header flags from the
+ * API context. Otherwise we have to call H5P_get */
+ if(H5CX_get_ohdr_flags(&oh_flags) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get object header flags")
+ }
+ else
+ {
+ if(H5P_get(oc_plist, H5O_CRT_OHDR_FLAGS_NAME, &oh_flags) < 0)
+ HGOTO_ERROR(H5E_PLIST, H5E_CANTGET, NULL, "can't get object header flags")
+ }
if(H5O_set_version(f, oh, oh_flags, H5F_STORE_MSG_CRT_IDX(f)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTSET, NULL, "can't set version of object header")