summaryrefslogtreecommitdiffstats
path: root/tools/lib
diff options
context:
space:
mode:
authorjhendersonHDF <jhenderson@hdfgroup.org>2022-05-06 18:06:07 (GMT)
committerGitHub <noreply@github.com>2022-05-06 18:06:07 (GMT)
commit13985a7f529a3628fe215478f9d77f0d5b9b0fd1 (patch)
treed82bdd79c45f99b5237977e3371af5a689014c14 /tools/lib
parentcdf837d0a16acd657e53057d19b4b21763eeca45 (diff)
downloadhdf5-13985a7f529a3628fe215478f9d77f0d5b9b0fd1.zip
hdf5-13985a7f529a3628fe215478f9d77f0d5b9b0fd1.tar.gz
hdf5-13985a7f529a3628fe215478f9d77f0d5b9b0fd1.tar.bz2
Fixes for S3 and HDFS VFDs with tools (#1740)
Diffstat (limited to 'tools/lib')
-rw-r--r--tools/lib/h5tools.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c
index 8768633..720d8c3 100644
--- a/tools/lib/h5tools.c
+++ b/tools/lib/h5tools.c
@@ -600,7 +600,7 @@ h5tools_set_fapl_vfd(hid_t fapl_id, h5tools_vfd_info_t *vfd_info)
done:
if (ret_value < 0) {
/* Clear error message unless asked for */
- if (enable_error_stack <= 1)
+ if ((H5tools_ERR_STACK_g >= 0) && (enable_error_stack <= 1))
H5Epop(H5tools_ERR_STACK_g, 1);
}
@@ -705,7 +705,7 @@ done:
H5TOOLS_ERROR(FAIL, "failed to decrement refcount on VOL connector ID");
/* Clear error message unless asked for */
- if (enable_error_stack <= 1)
+ if ((H5tools_ERR_STACK_g >= 0) && (enable_error_stack <= 1))
H5Epop(H5tools_ERR_STACK_g, 1);
}
@@ -762,7 +762,7 @@ done:
}
/* Clear error message unless asked for */
- if (enable_error_stack <= 1)
+ if ((H5tools_ERR_STACK_g >= 0) && (enable_error_stack <= 1))
H5Epop(H5tools_ERR_STACK_g, 1);
}
@@ -1033,8 +1033,10 @@ done:
H5Pclose(tmp_fapl_id);
/* Clear error message unless asked for */
- if (ret_value < 0 && enable_error_stack <= 1)
- H5Epop(H5tools_ERR_STACK_g, 1);
+ if (ret_value < 0) {
+ if ((H5tools_ERR_STACK_g >= 0) && (enable_error_stack <= 1))
+ H5Epop(H5tools_ERR_STACK_g, 1);
+ }
return ret_value;
}