diff options
author | Klotz, Tobias <tobias.klotz@draeger.com> | 2018-12-20 12:59:31 +0100 |
---|---|---|
committer | Dr. Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com> | 2019-01-24 17:55:04 +0100 |
commit | 5c8b7b4caa0faedb69277063a7c6b3a8e56c6308 (patch) | |
tree | c517ee78963ae830a90f376442578fd88e63faea /test/ssltestlib.c | |
parent | 0b53fe1cdc24a3dce450e77db6895a0243ddcb26 (diff) |
Cleanup vxworks support to be able to compile for VxWorks 7
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Matthias St. Pierre <Matthias.St.Pierre@ncp-e.com>
(Merged from https://github.com/openssl/openssl/pull/7569)
Diffstat (limited to 'test/ssltestlib.c')
-rw-r--r-- | test/ssltestlib.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/test/ssltestlib.c b/test/ssltestlib.c index 2f662674e7..8d7ab610fb 100644 --- a/test/ssltestlib.c +++ b/test/ssltestlib.c @@ -25,18 +25,28 @@ # include <fcntl.h> #endif -static ossl_inline void ossl_sleep(unsigned int millis) { +static ossl_inline void ossl_sleep(unsigned int millis) +{ +# ifdef OPENSSL_SYS_VXWORKS + struct timespec ts; + ts.tv_sec = (long int) (millis / 1000); + ts.tv_nsec = (long int) (millis % 1000) * 1000000ul; + nanosleep(&ts, NULL); +# else usleep(millis * 1000); +# endif } #elif defined(_WIN32) # include <windows.h> -static ossl_inline void ossl_sleep(unsigned int millis) { +static ossl_inline void ossl_sleep(unsigned int millis) +{ Sleep(millis); } #else /* Fallback to a busy wait */ -static ossl_inline void ossl_sleep(unsigned int millis) { +static ossl_inline void ossl_sleep(unsigned int millis) +{ struct timeval start, now; unsigned int elapsedms; |