summaryrefslogtreecommitdiffstats
path: root/src/H5VLint.c
diff options
context:
space:
mode:
authorLarry Knox <lrknox@hdfgroup.org>2020-10-10 04:59:37 (GMT)
committerLarry Knox <lrknox@hdfgroup.org>2020-10-10 04:59:37 (GMT)
commitd282d8e8468cfd67172fe8b7db0786d9cdf33e03 (patch)
treedd795c0b640fb3e104850d932b69e009a534742d /src/H5VLint.c
parentb2e40065d1ad402b6cccd4180d9d61f0e570a17d (diff)
parentd4b1ee1d861686b97a887f47ff3857e338d3f690 (diff)
downloadhdf5-d282d8e8468cfd67172fe8b7db0786d9cdf33e03.zip
hdf5-d282d8e8468cfd67172fe8b7db0786d9cdf33e03.tar.gz
hdf5-d282d8e8468cfd67172fe8b7db0786d9cdf33e03.tar.bz2
Merge branch 'hdf5_1_12' of https://github.com/HDFGroup/hdf5 into hdf5_1_12
Diffstat (limited to 'src/H5VLint.c')
-rw-r--r--src/H5VLint.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/src/H5VLint.c b/src/H5VLint.c
index b1c690a..cc5b8b7 100644
--- a/src/H5VLint.c
+++ b/src/H5VLint.c
@@ -2315,24 +2315,26 @@ H5VL_wrap_register(H5I_type_t type, void *obj, hbool_t app_ref)
/* Sanity check */
HDassert(obj);
+ /* Retrieve the VOL object wrapping context */
+ if (H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0)
+ HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context")
+ if (NULL == vol_wrap_ctx || NULL == vol_wrap_ctx->connector)
+ HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, H5I_INVALID_HID,
+ "VOL object wrap context or its connector is NULL???")
+
/* If the datatype is already VOL-managed, the datatype's vol_obj
* field will get clobbered later, so disallow this.
*/
- if (type == H5I_DATATYPE)
- if (TRUE == H5T_already_vol_managed((const H5T_t *)obj))
- HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, H5I_INVALID_HID, "can't wrap an uncommitted datatype")
+ if (type == H5I_DATATYPE) {
+ if (vol_wrap_ctx->connector->id == H5VL_NATIVE)
+ if (TRUE == H5T_already_vol_managed((const H5T_t *)obj))
+ HGOTO_ERROR(H5E_VOL, H5E_BADTYPE, H5I_INVALID_HID, "can't wrap an uncommitted datatype")
+ }
/* Wrap the object with VOL connector info */
if (NULL == (new_obj = H5VL__wrap_obj(obj, type)))
HGOTO_ERROR(H5E_VOL, H5E_CANTCREATE, H5I_INVALID_HID, "can't wrap library object")
- /* Retrieve the VOL object wrapping context */
- if (H5CX_get_vol_wrap_ctx((void **)&vol_wrap_ctx) < 0)
- HGOTO_ERROR(H5E_VOL, H5E_CANTGET, H5I_INVALID_HID, "can't get VOL object wrap context")
- if (NULL == vol_wrap_ctx || NULL == vol_wrap_ctx->connector)
- HGOTO_ERROR(H5E_VOL, H5E_BADVALUE, H5I_INVALID_HID,
- "VOL object wrap context or its connector is NULL???")
-
/* Get an ID for the object */
if ((ret_value = H5VL_register_using_vol_id(type, new_obj, vol_wrap_ctx->connector->id, app_ref)) < 0)
HGOTO_ERROR(H5E_VOL, H5E_CANTREGISTER, H5I_INVALID_HID, "unable to get an ID for the object")