diff options
author | Albert Cheng <acheng@hdfgroup.org> | 2009-10-18 04:51:20 (GMT) |
---|---|---|
committer | Albert Cheng <acheng@hdfgroup.org> | 2009-10-18 04:51:20 (GMT) |
commit | a7db9a67b5b9fd9a74ffe0cb9db07bf701fe93f9 (patch) | |
tree | a83bb32e1916dfd630d376f303f50e6655a7cbd9 /test/tcheck_version.c | |
parent | dfb22d02b04f70beb06e1280e2080ae32d4c20c1 (diff) | |
download | hdf5-a7db9a67b5b9fd9a74ffe0cb9db07bf701fe93f9.zip hdf5-a7db9a67b5b9fd9a74ffe0cb9db07bf701fe93f9.tar.gz hdf5-a7db9a67b5b9fd9a74ffe0cb9db07bf701fe93f9.tar.bz2 |
[svn-r17667] Bug 1656 fix:
added a signal handler to the tcheck_version to intercept the abort signal from
H5check_version. Some systems would prints extra messages and/or core dump if
the abort signal is not handled. This eliminates those unwanted side effect.
Tested: h5committested.
Diffstat (limited to 'test/tcheck_version.c')
-rw-r--r-- | test/tcheck_version.c | 25 |
1 files changed, 22 insertions, 3 deletions
diff --git a/test/tcheck_version.c b/test/tcheck_version.c index 7a34b26..d8894b3 100644 --- a/test/tcheck_version.c +++ b/test/tcheck_version.c @@ -25,14 +25,19 @@ * * Programmer: Albert Cheng * September 20, 2009 + * Modifications: + * Added abort signal intercept. AKC - 2009/10/16 - */ - -#include <stdlib.h> -#include "hdf5.h" +#include "h5test.h" #define progname "tcheck_version" +/* prototypes */ +void showhelp(void); +void parse(int ac, char **av); +void abort_intercept (int UNUSED sig); + /* global variables */ unsigned major = H5_VERS_MAJOR; unsigned minor = H5_VERS_MINOR; @@ -90,10 +95,24 @@ parse(int ac, char **av) } } +/* Handler for SIGABRT - catch the abort signal supposedly from check_version() + * and exit(134). 134 would have been the return code in Unix systems. + * This handles the abort signal instead letting it interrupt the OS because + * some systems may produce extra messages and/or produce core dump. + * This tries to eliminate those side effects. + */ +void +abort_intercept (int UNUSED sig) +{ + HDexit(134); +} + int main(int ac, char **av) { parse(ac, av); + HDsignal(SIGABRT, &abort_intercept); H5check_version(major, minor, release); + HDsignal(SIGABRT, SIG_DFL); return 0; } |