From 55ff5c24130dbf1dbcb749e9293ebd377cc36d45 Mon Sep 17 00:00:00 2001 From: Quincey Koziol Date: Mon, 23 Sep 2024 17:48:22 -0500 Subject: [PATCH] Remove H5E_clear_stack() from library Use existing H5G_loc_exists() routine Signed-off-by: Quincey Koziol --- src/H5Gloc.c | 3 +-- src/H5Ocopy.c | 11 ++++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/H5Gloc.c b/src/H5Gloc.c index 897debcb1bd..8f9f74fd368 100644 --- a/src/H5Gloc.c +++ b/src/H5Gloc.c @@ -608,8 +608,7 @@ H5G__loc_exists_cb(H5G_loc_t H5_ATTR_UNUSED *grp_loc /*in*/, const char H5_ATTR_ * * Purpose: Check if an object actually exists at a location * - * Return: Success: true/false - * Failure: Negative + * Return: Non-negative on success/Negative on failure * *------------------------------------------------------------------------- */ diff --git a/src/H5Ocopy.c b/src/H5Ocopy.c index 6299b7583af..137cca49f21 100644 --- a/src/H5Ocopy.c +++ b/src/H5Ocopy.c @@ -1464,12 +1464,13 @@ H5O__copy_search_comm_dt(H5F_t *file_src, H5O_t *oh_src, H5O_loc_t *oloc_dst /*i /* Walk through the list of datatype suggestions */ while (suggestion) { + bool exists = false; + /* Find the object */ - if (H5G_loc_find(&dst_root_loc, suggestion->path, &obj_loc /*out*/) < 0) - /* Ignore errors - i.e. suggestions not present in - * destination file */ - H5E_clear_stack(); - else + if (H5G_loc_exists(&dst_root_loc, suggestion->path, &exists /*out*/) < 0) + HGOTO_ERROR(H5E_OHDR, H5E_CANTFIND, FAIL, "can't check object's existance"); + + if (exists) /* Check object and add to skip list if appropriate */ if (H5O__copy_search_comm_dt_check(&obj_oloc, &udata) < 0) { if (H5G_loc_free(&obj_loc) < 0)