summaryrefslogtreecommitdiffstats
path: root/src/H5Oint.c
diff options
context:
space:
mode:
authorDavid Young <dyoung@hdfgroup.org>2019-11-25 22:38:21 (GMT)
committerDavid Young <dyoung@hdfgroup.org>2019-11-25 22:38:21 (GMT)
commitd07aeef6adaf7c4f6d97ceb213d60cc60a8dbc6e (patch)
tree87e88628f584724b4ec2af1ee6e3cc2a01e00cf1 /src/H5Oint.c
parentf2f8a554e65ee3e3ca501adf80fbdfd0225dac3f (diff)
parentb8a56718e40efaf6954a760984b9d513dbff8f7d (diff)
downloadhdf5-d07aeef6adaf7c4f6d97ceb213d60cc60a8dbc6e.zip
hdf5-d07aeef6adaf7c4f6d97ceb213d60cc60a8dbc6e.tar.gz
hdf5-d07aeef6adaf7c4f6d97ceb213d60cc60a8dbc6e.tar.bz2
Merge remote-tracking branch 'hdf5/develop' into add-werror-and-squash-some
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 ecf347c..b97ff30 100644
--- a/src/H5Oint.c
+++ b/src/H5Oint.c
@@ -352,8 +352,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")