diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2012-03-12 17:47:27 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2012-03-12 17:47:27 (GMT) |
commit | 10179b33ee1fd768c77930110d7e6129c67956ab (patch) | |
tree | 1b9ea046ba421bc98cd000addb8e10dc0f5bffcf /tools/lib/h5tools.c | |
parent | e95d26cc668413e18e09a37d84852e59dd8b4446 (diff) | |
download | hdf5-10179b33ee1fd768c77930110d7e6129c67956ab.zip hdf5-10179b33ee1fd768c77930110d7e6129c67956ab.tar.gz hdf5-10179b33ee1fd768c77930110d7e6129c67956ab.tar.bz2 |
[svn-r22045] HDFFV-7957-7958:
Add tools error stack and check return from H5Dreference call.
Tested: trunk
Diffstat (limited to 'tools/lib/h5tools.c')
-rw-r--r-- | tools/lib/h5tools.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 0d29686..d9b6e81 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -35,6 +35,7 @@ #define ALIGN(A,Z) ((((A) + (Z) - 1) / (Z)) * (Z)) /* global variables */ +hid_t H5tools_ERR_STACK_g = 0; hid_t H5tools_ERR_CLS_g = -1; hid_t H5E_tools_g = -1; hid_t H5E_tools_min_id_g = -1; @@ -115,6 +116,7 @@ h5tools_init(void) /* register the error class */ HDsnprintf(lib_str, sizeof(lib_str), "%d.%d.%d",H5_VERS_MAJOR, H5_VERS_MINOR, H5_VERS_RELEASE); + H5tools_ERR_STACK_g = H5Ecreate_stack(); H5TOOLS_INIT_ERROR() if (!rawdatastream) @@ -149,7 +151,12 @@ h5tools_init(void) void h5tools_close(void) { + H5E_auto2_t tools_func; + void *tools_edata; if (h5tools_init_g) { + H5Eget_auto2(H5tools_ERR_STACK_g, &tools_func, &tools_edata); + if(tools_func!=NULL) + H5Eprint(H5tools_ERR_STACK_g, rawerrorstream); if (rawdatastream && rawdatastream != stdout) { if (fclose(rawdatastream)) perror("closing rawdatastream"); @@ -173,7 +180,7 @@ h5tools_close(void) term_ref_path_table(); H5TOOLS_CLOSE_ERROR() - + H5Eclose_stack(H5tools_ERR_STACK_g); /* Shut down the library */ H5close(); |