X-Git-Url: https://git.librecmc.org/?a=blobdiff_plain;f=crypto%2Fbio%2Fbss_dgram.c;h=f8215f440dcca926c2453d9c110a51cfbbf4ebd6;hb=94782e0e9c28bd872107b8f814f4db68c9fbf5ab;hp=7b87a043c430fbe21691a1514f0206c87a22d2e5;hpb=5833e4f5d63b2ca9637c1427a1efc170c479b925;p=oweals%2Fopenssl.git diff --git a/crypto/bio/bss_dgram.c b/crypto/bio/bss_dgram.c index 7b87a043c4..f8215f440d 100644 --- a/crypto/bio/bss_dgram.c +++ b/crypto/bio/bss_dgram.c @@ -66,7 +66,7 @@ #include #ifndef OPENSSL_NO_DGRAM -#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_VMS) +#if defined(OPENSSL_SYS_VMS) #include #endif @@ -1895,11 +1895,15 @@ int BIO_dgram_non_fatal_error(int err) static void get_current_time(struct timeval *t) { -#ifdef OPENSSL_SYS_WIN32 - struct _timeb tb; - _ftime(&tb); - t->tv_sec = (long)tb.time; - t->tv_usec = (long)tb.millitm * 1000; +#if defined(_WIN32) + SYSTEMTIME st; + union { unsigned __int64 ul; FILETIME ft; } now; + + GetSystemTime(&st); + SystemTimeToFileTime(&st,&now.ft); + now.ul -= 116444736000000000UI64; /* re-bias to 1/1/1970 */ + t->tv_sec = (long)(now.ul/10000000); + t->tv_usec = ((int)(now.ul%10000000))/10; #elif defined(OPENSSL_SYS_VMS) struct timeb tb; ftime(&tb);