diff options
Diffstat (limited to 'src/H5Itest.c')
-rw-r--r-- | src/H5Itest.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/H5Itest.c b/src/H5Itest.c index 71ef3f8..80738a9 100644 --- a/src/H5Itest.c +++ b/src/H5Itest.c @@ -71,6 +71,7 @@ H5I__get_name_test(hid_t id, char *name /*out*/, size_t size, hbool_t *cached) H5G_loc_t loc; /* Object location */ hbool_t api_ctx_pushed = FALSE; /* Whether API context pushed */ hbool_t vol_wrapper_set = FALSE; /* Whether the VOL object wrapping context was set up */ + size_t name_len = 0; /* Length of name */ ssize_t ret_value = -1; /* Return value */ FUNC_ENTER_PACKAGE @@ -86,7 +87,7 @@ H5I__get_name_test(hid_t id, char *name /*out*/, size_t size, hbool_t *cached) /* Set wrapper info in API context */ if (H5VL_set_vol_wrapper(vol_obj) < 0) - HGOTO_ERROR(H5E_ID, H5E_CANTSET, FAIL, "can't set VOL wrapper info") + HGOTO_ERROR(H5E_ID, H5E_CANTSET, (-1), "can't set VOL wrapper info") vol_wrapper_set = TRUE; /* Get object location */ @@ -94,13 +95,16 @@ H5I__get_name_test(hid_t id, char *name /*out*/, size_t size, hbool_t *cached) HGOTO_ERROR(H5E_ID, H5E_CANTGET, (-1), "can't retrieve object location") /* Call internal group routine to retrieve object's name */ - if ((ret_value = H5G_get_name(&loc, name, size, cached)) < 0) + if (H5G_get_name(&loc, name, size, &name_len, cached) < 0) HGOTO_ERROR(H5E_ID, H5E_CANTGET, (-1), "can't retrieve object name") + /* Set return value */ + ret_value = (ssize_t)name_len; + done: /* Reset object wrapping info in API context */ if (vol_wrapper_set && H5VL_reset_vol_wrapper() < 0) - HDONE_ERROR(H5E_ID, H5E_CANTRESET, FAIL, "can't reset VOL wrapper info") + HDONE_ERROR(H5E_ID, H5E_CANTRESET, (-1), "can't reset VOL wrapper info") if (api_ctx_pushed && H5CX_pop(FALSE) < 0) HDONE_ERROR(H5E_SYM, H5E_CANTRESET, (-1), "can't reset API context") |