diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2020-07-15 16:20:16 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2020-07-15 16:20:16 (GMT) |
commit | bac0fc6309aaf777d4b6d093cf027dce3ecfb58c (patch) | |
tree | 1b944edb35a01a5bb8bb72445f82afb52317f06e /tools/src/h5jam/h5unjam.c | |
parent | 900e75544e214a82de3b7fcdbc083ee71d484892 (diff) | |
download | hdf5-bac0fc6309aaf777d4b6d093cf027dce3ecfb58c.zip hdf5-bac0fc6309aaf777d4b6d093cf027dce3ecfb58c.tar.gz hdf5-bac0fc6309aaf777d4b6d093cf027dce3ecfb58c.tar.bz2 |
Tools refactor
Move error_stack setup to tools library
Add structure for h5dump properties
Eliminate duplicated h5diff functions
Use properties structure in place of argument lists.
Diffstat (limited to 'tools/src/h5jam/h5unjam.c')
-rw-r--r-- | tools/src/h5jam/h5unjam.c | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/tools/src/h5jam/h5unjam.c b/tools/src/h5jam/h5unjam.c index 203522b..b48e2c1 100644 --- a/tools/src/h5jam/h5unjam.c +++ b/tools/src/h5jam/h5unjam.c @@ -185,6 +185,13 @@ done: return EXIT_FAILURE; } +static void +leave(int ret) +{ + h5tools_close(); + HDexit(ret); +} + /*------------------------------------------------------------------------- * Function: main * @@ -197,8 +204,6 @@ done: int main(int argc, const char *argv[]) { - void *edata; - H5E_auto2_t func; hid_t ifile = H5I_INVALID_HID; hid_t plist = H5I_INVALID_HID; off_t fsize; @@ -211,16 +216,15 @@ main(int argc, const char *argv[]) h5tools_setprogname(PROGRAMNAME); h5tools_setstatus(EXIT_SUCCESS); - /* Disable error reporting */ - H5Eget_auto2(H5E_DEFAULT, &func, &edata); - H5Eset_auto2(H5E_DEFAULT, NULL, NULL); - /* Initialize h5tools lib */ h5tools_init(); if(EXIT_FAILURE == parse_command_line(argc, argv)) goto done; + /* enable error reporting if command line option */ + h5tools_error_report(); + if (input_file == NULL) { /* no user block */ error_msg("missing argument for HDF5 file input.\n"); @@ -319,9 +323,7 @@ done: HDfree(ub_file); } - h5tools_close(); - - return h5tools_getstatus(); + leave(h5tools_getstatus()); } /*------------------------------------------------------------------------- |