summaryrefslogtreecommitdiffstats
path: root/src/H5VLcallback.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5VLcallback.c')
-rw-r--r--src/H5VLcallback.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/src/H5VLcallback.c b/src/H5VLcallback.c
index a61b003..2369be5 100644
--- a/src/H5VLcallback.c
+++ b/src/H5VLcallback.c
@@ -3527,6 +3527,7 @@ H5VL__file_open_find_connector_cb(H5PL_type_t plugin_type, const void *plugin_in
H5P_genplist_t * fapl_plist;
H5P_genplist_t * fapl_plist_copy;
hbool_t is_accessible = FALSE; /* Whether file is accessible */
+ ssize_t num_errors = 0;
herr_t status;
hid_t connector_id = H5I_INVALID_HID;
hid_t fapl_id = H5I_INVALID_HID;
@@ -3565,6 +3566,10 @@ H5VL__file_open_find_connector_cb(H5PL_type_t plugin_type, const void *plugin_in
vol_cb_args.args.is_accessible.fapl_id = fapl_id;
vol_cb_args.args.is_accessible.accessible = &is_accessible;
+ /* Store current error stack size */
+ if ((num_errors = H5Eget_num(H5E_DEFAULT)) < 0)
+ HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, H5_ITER_ERROR, "can't get current error stack size")
+
/* Check if file is accessible with given VOL connector */
H5E_BEGIN_TRY
{
@@ -3572,11 +3577,23 @@ H5VL__file_open_find_connector_cb(H5PL_type_t plugin_type, const void *plugin_in
}
H5E_END_TRY;
- /* If the file was accessible with the current VOL connector, return
- * the FAPL with that VOL connector set on it. Errors are ignored here
- * as some VOL connectors may not support H5Fis_accessible.
- */
- if (status == SUCCEED && is_accessible) {
+ if (status < 0) {
+ ssize_t new_num_errors = 0;
+
+ /* Pop any errors generated by the above call */
+ if ((new_num_errors = H5Eget_num(H5E_DEFAULT)) < 0)
+ HGOTO_ERROR(H5E_ERROR, H5E_CANTGET, H5_ITER_ERROR, "can't get current error stack size")
+ if (new_num_errors > num_errors) {
+ new_num_errors -= num_errors;
+ if (H5Epop(H5E_DEFAULT, (size_t)new_num_errors) < 0)
+ HGOTO_ERROR(H5E_ERROR, H5E_CANTRELEASE, H5_ITER_ERROR, "can't sanitize error stack")
+ }
+ }
+ else if (status == SUCCEED && is_accessible) {
+ /* If the file was accessible with the current VOL connector, return
+ * the FAPL with that VOL connector set on it.
+ */
+
/* Modify 'connector_prop' to point to the VOL connector that
* was actually used to open the file, rather than the original
* VOL connector that was requested.
@@ -3586,7 +3603,7 @@ H5VL__file_open_find_connector_cb(H5PL_type_t plugin_type, const void *plugin_in
udata->fapl_id = fapl_id;
ret_value = H5_ITER_STOP;
- } /* end if */
+ }
done:
if (ret_value != H5_ITER_STOP) {