summaryrefslogtreecommitdiffstats
path: root/src/H5Oint.c
diff options
context:
space:
mode:
authorkmu <kmu@hdfgroup.org>2019-11-27 03:59:51 (GMT)
committerkmu <kmu@hdfgroup.org>2019-11-27 03:59:51 (GMT)
commitea0759d047dc6421da90375a9c27f7cde0a8e117 (patch)
tree81df83e8c53a80b61365d579b26aeb9532fe493f /src/H5Oint.c
parente0262c8bedf0e59b7b32b02ecd91ed50cf834a1c (diff)
parent9f61c26927ac74c4498cbebd7c9f2166d5f5b786 (diff)
downloadhdf5-ea0759d047dc6421da90375a9c27f7cde0a8e117.zip
hdf5-ea0759d047dc6421da90375a9c27f7cde0a8e117.tar.gz
hdf5-ea0759d047dc6421da90375a9c27f7cde0a8e117.tar.bz2
Merge branch 'develop' of https://git.hdfgroup.org/scm/hdffv/hdf5 into develop
Diffstat (limited to 'src/H5Oint.c')
-rw-r--r--src/H5Oint.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/H5Oint.c b/src/H5Oint.c
index ecf347c..0029976 100644
--- a/src/H5Oint.c
+++ b/src/H5Oint.c
@@ -31,6 +31,7 @@
/* Headers */
/***********/
#include "H5private.h" /* Generic Functions */
+#include "H5CXprivate.h" /* API contexts */
#include "H5Eprivate.h" /* Error handling */
#include "H5Fprivate.h" /* File access */
#include "H5FLprivate.h" /* Free lists */
@@ -352,8 +353,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")