Skip to content

Commit

Permalink
Remove H5E_clear_stack() from library (HDFGroup#4871)
Browse files Browse the repository at this point in the history
Use existing H5G_loc_exists() routine
  • Loading branch information
qkoziol authored Oct 1, 2024
1 parent e080498 commit fe2de0f
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 10 deletions.
3 changes: 1 addition & 2 deletions src/H5Gloc.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
*
*-------------------------------------------------------------------------
*/
Expand Down
22 changes: 14 additions & 8 deletions src/H5Ocopy.c
Original file line number Diff line number Diff line change
Expand Up @@ -1464,22 +1464,28 @@ 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 existence");

if (exists) {
/* Retrieve the object location info */
if (H5G_loc_find(&dst_root_loc, suggestion->path, &obj_loc /*out*/) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't retrieve object location");

/* 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)
HERROR(H5E_OHDR, H5E_CANTRELEASE, "can't free location");
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "can't check object");
} /* end if */

/* Free location */
if (H5G_loc_free(&obj_loc) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location");
/* Free location */
if (H5G_loc_free(&obj_loc) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTRELEASE, FAIL, "can't free location");
} /* end if */

/* Advance the suggestion pointer */
suggestion = suggestion->next;
Expand Down

0 comments on commit fe2de0f

Please sign in to comment.