diff options
author | Dana Robinson <43805+derobins@users.noreply.github.com> | 2021-03-11 21:34:55 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-03-11 21:34:55 (GMT) |
commit | 6f760f200d6cb959c960b936af3fb2e68a55afde (patch) | |
tree | 65417bef3aaa8b351000377ad20de6687e34830f /test/dt_arith.c | |
parent | a78aae1150ffdfd44ef64c46da099c9412a7c3d0 (diff) | |
download | hdf5-6f760f200d6cb959c960b936af3fb2e68a55afde.zip hdf5-6f760f200d6cb959c960b936af3fb2e68a55afde.tar.gz hdf5-6f760f200d6cb959c960b936af3fb2e68a55afde.tar.bz2 |
Replaces checks for fork, etc. with checks for unistd.h (#457)
* Replaces checks for fork, etc. with H5_HAVE_UNISTD_H
Code previously checked for individual POSIX API calls using
H5_HAVE_FORK, etc. The calls we use have been standardized for
decades and available via unistd.h.
Some test messages that were missing when tests are skipped
due to a lack of unistd.h were also added.
The configure checks for individual POSIX API calls will be
removed in a later commit.
* Stupid formatter
Diffstat (limited to 'test/dt_arith.c')
-rw-r--r-- | test/dt_arith.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/test/dt_arith.c b/test/dt_arith.c index 81b4b46..8658ccb 100644 --- a/test/dt_arith.c +++ b/test/dt_arith.c @@ -84,7 +84,7 @@ static int skip_overflow_tests_g = 0; * be allowed to continue (cf. Posix signals) so in order to recover from a * SIGFPE we run tests that might generate one in a child process. */ -#if defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) +#ifdef H5_HAVE_UNISTD_H #define HANDLE_SIGFPE #endif @@ -556,7 +556,7 @@ some_dummy_func(float x) static void generates_sigfpe(void) { -#if defined(H5_HAVE_FORK) && defined(H5_HAVE_WAITPID) +#ifdef H5_HAVE_UNISTD_H pid_t pid; int status; size_t i, j; @@ -592,12 +592,12 @@ generates_sigfpe(void) /* delete the core dump file that SIGFPE may have created */ HDunlink("core"); } -#else - HDputs("Cannot determine if floating-point overflows generate a SIGFPE;"); - HDputs("assuming yes."); +#else /* H5_HAVE_UNISTD_H */ + HDputs("Cannot determine if floating-point overflows generate a SIGFPE"); + HDputs("due to a lack of fork(2) - assuming yes."); HDputs("Overflow cases will not be tested."); skip_overflow_tests_g = TRUE; -#endif +#endif /* H5_HAVE_UNISTD_H */ } /*------------------------------------------------------------------------- |