summaryrefslogtreecommitdiffstats
path: root/src/H5Olink.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2018-10-26 22:27:10 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2018-10-26 22:27:10 (GMT)
commitce3d1ec9ea5a7a0627d948687d64dc7e5e76f6cd (patch)
treeddf31eb610bea93dbd800e10b30cc7e17bd71b6f /src/H5Olink.c
parent171deaa588183b5a3a9d27a5f3f407d398ba53db (diff)
downloadhdf5-ce3d1ec9ea5a7a0627d948687d64dc7e5e76f6cd.zip
hdf5-ce3d1ec9ea5a7a0627d948687d64dc7e5e76f6cd.tar.gz
hdf5-ce3d1ec9ea5a7a0627d948687d64dc7e5e76f6cd.tar.bz2
Eliminate last call to H5VL_native_register, shifting everything over to
the VOL plugin wrapping code.
Diffstat (limited to 'src/H5Olink.c')
-rw-r--r--src/H5Olink.c15
1 files changed, 6 insertions, 9 deletions
diff --git a/src/H5Olink.c b/src/H5Olink.c
index 961c619..55e1aee 100644
--- a/src/H5Olink.c
+++ b/src/H5Olink.c
@@ -612,6 +612,7 @@ herr_t
H5O_link_delete(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg)
{
H5O_link_t *lnk = (H5O_link_t *)_mesg;
+ hid_t file_id = -1; /* ID for the file the link is located in (passed to user callback) */
herr_t ret_value = SUCCEED; /* Return value */
FUNC_ENTER_NOAPI(FAIL)
@@ -645,25 +646,21 @@ H5O_link_delete(H5F_t *f, H5O_t H5_ATTR_UNUSED *open_oh, void *_mesg)
/* Check for delete callback */
if(link_class->del_func) {
- hid_t file_id; /* ID for the file the link is located in (passed to user callback) */
-
/* Get a file ID for the file the link is in */
if((file_id = H5F_get_id(f)) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CANTGET, FAIL, "unable to get file ID")
/* Call user-defined link's 'delete' callback */
- if((link_class->del_func)(lnk->name, file_id, lnk->u.ud.udata, lnk->u.ud.size) < 0) {
- H5I_dec_ref(file_id);
+ if((link_class->del_func)(lnk->name, file_id, lnk->u.ud.udata, lnk->u.ud.size) < 0)
HGOTO_ERROR(H5E_OHDR, H5E_CALLBACK, FAIL, "link deletion callback returned failure")
- } /* end if */
-
- /* Release the file ID */
- if(H5I_dec_ref(file_id) < 0)
- HGOTO_ERROR(H5E_OHDR, H5E_CANTCLOSEFILE, FAIL, "can't close file")
} /* end if */
} /* end if */
done:
+ /* Release the file ID */
+ if(file_id > 0 && H5I_dec_ref(file_id) < 0)
+ HDONE_ERROR(H5E_OHDR, H5E_CANTCLOSEFILE, FAIL, "can't close file")
+
FUNC_LEAVE_NOAPI(ret_value)
} /* end H5O_link_delete() */