diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2012-03-12 16:33:15 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2012-03-12 16:33:15 (GMT) |
commit | bec199165a54b8c369c40a11b9159771fb947b1c (patch) | |
tree | 266d26159e2a4251383a9803a93145b90a727115 /tools/lib/h5tools.c | |
parent | 80b2b54f416f102404ba9f7f724ec3e8241a4b71 (diff) | |
download | hdf5-bec199165a54b8c369c40a11b9159771fb947b1c.zip hdf5-bec199165a54b8c369c40a11b9159771fb947b1c.tar.gz hdf5-bec199165a54b8c369c40a11b9159771fb947b1c.tar.bz2 |
[svn-r22042] HDFFV-7957-7958:
Add tools error stack and check return from H5Dreference call.
Tested: CMake and h5committest
Diffstat (limited to 'tools/lib/h5tools.c')
-rw-r--r-- | tools/lib/h5tools.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 30b8f33..ba9510e 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; @@ -114,7 +115,8 @@ h5tools_init(void) if (!h5tools_init_g) { /* 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(); |