X-Git-Url: http://git.ipfire.org/?p=thirdparty%2Fopenssl.git;a=blobdiff_plain;f=test%2Fssltestlib.c;fp=test%2Fssltestlib.c;h=66d4e9b3a072268ed0e66718441f45b9a4cc1caf;hp=3f63cf9c20b4a0b9b11a2dd36a3732eb965add70;hb=e8d0819d52b2741fcb4ddb79ced4d824c3056918;hpb=745fc918e7eeb86b2ac541325a8ae5c6e374ee56 diff --git a/test/ssltestlib.c b/test/ssltestlib.c index 3f63cf9c20..66d4e9b3a0 100644 --- a/test/ssltestlib.c +++ b/test/ssltestlib.c @@ -10,53 +10,21 @@ #include #include "internal/nelem.h" +#include "internal/cryptlib.h" /* for ossl_sleep() */ #include "ssltestlib.h" #include "testutil.h" #include "e_os.h" #ifdef OPENSSL_SYS_UNIX # include -#ifndef OPENSSL_NO_KTLS -# include -# include -# include -# include -# include -# include -#endif - -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); +# ifndef OPENSSL_NO_KTLS +# include +# include +# include +# include +# include +# include # endif -} -#elif defined(_WIN32) -# include - -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) -{ - struct timeval start, now; - unsigned int elapsedms; - - gettimeofday(&start, NULL); - do { - gettimeofday(&now, NULL); - elapsedms = (((now.tv_sec - start.tv_sec) * 1000000) - + now.tv_usec - start.tv_usec) / 1000; - } while (elapsedms < millis); -} #endif static int tls_dump_new(BIO *bi);