diff options
author | Allen Byrne <byrn@hdfgroup.org> | 2018-02-19 19:22:19 (GMT) |
---|---|---|
committer | Allen Byrne <byrn@hdfgroup.org> | 2018-02-19 19:22:19 (GMT) |
commit | 905b1456abfc65ee370c64aea672442f5f3a7ecd (patch) | |
tree | 0086d60d2f74e400410515e6fcc364381666113d /tools/lib | |
parent | f7d2fbe58db16922e6ff360f46e4334bbcd88831 (diff) | |
download | hdf5-905b1456abfc65ee370c64aea672442f5f3a7ecd.zip hdf5-905b1456abfc65ee370c64aea672442f5f3a7ecd.tar.gz hdf5-905b1456abfc65ee370c64aea672442f5f3a7ecd.tar.bz2 |
HDFFV-10384 merge from develop
Diffstat (limited to 'tools/lib')
-rw-r--r-- | tools/lib/h5tools.c | 22 | ||||
-rw-r--r-- | tools/lib/h5tools.h | 2 |
2 files changed, 18 insertions, 6 deletions
diff --git a/tools/lib/h5tools.c b/tools/lib/h5tools.c index 9230bb1..8ceaecc 100644 --- a/tools/lib/h5tools.c +++ b/tools/lib/h5tools.c @@ -43,7 +43,7 @@ unsigned packed_bits_num; /* number of packed bits to display */ unsigned packed_data_offset; /* offset of packed bits to display */ unsigned packed_data_length; /* length of packed bits to display */ unsigned long long packed_data_mask; /* mask in which packed bits to display */ -int enable_error_stack= FALSE; /* re-enable error stack */ +int enable_error_stack = 0; /* re-enable error stack; disable=0 enable=1 */ /* sort parameters */ H5_index_t sort_by = H5_INDEX_NAME; /*sort_by [creation_order | name] */ @@ -548,9 +548,15 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, const char *driver, if ((my_fapl = h5tools_get_fapl(fapl, driver, &drivernum)) < 0) goto done; - H5E_BEGIN_TRY { + /* allow error stack display if enable-error-stack has optional arg number */ + if (enable_error_stack > 1) { fid = H5Fopen(fname, flags, my_fapl); - } H5E_END_TRY; + } + else { + H5E_BEGIN_TRY { + fid = H5Fopen(fname, flags, my_fapl); + } H5E_END_TRY; + } if (fid == FAIL) goto done; @@ -563,9 +569,15 @@ h5tools_fopen(const char *fname, unsigned flags, hid_t fapl, const char *driver, if((my_fapl = h5tools_get_fapl(fapl, drivernames[drivernum], NULL)) < 0) goto done; - H5E_BEGIN_TRY { + /* allow error stack display if enable-error-stack has optional arg number */ + if (enable_error_stack > 1) { fid = H5Fopen(fname, flags, my_fapl); - } H5E_END_TRY; + } + else { + H5E_BEGIN_TRY { + fid = H5Fopen(fname, flags, my_fapl); + } H5E_END_TRY; + } if (fid != FAIL) break; diff --git a/tools/lib/h5tools.h b/tools/lib/h5tools.h index 09ec527..e24d654 100644 --- a/tools/lib/h5tools.h +++ b/tools/lib/h5tools.h @@ -545,7 +545,7 @@ H5TOOLS_DLLVAR H5_index_t sort_by; /*sort_by [creation_order | name] * H5TOOLS_DLLVAR H5_iter_order_t sort_order; /*sort_order [ascending | descending] */ /* things to display or which are set via command line parameters */ -H5TOOLS_DLLVAR int enable_error_stack; /* re-enable error stack */ +H5TOOLS_DLLVAR int enable_error_stack; /* re-enable error stack; disable=0 enable=1 */ /* Strings for output */ #define H5_TOOLS_GROUP "GROUP" |