mirror of
https://github.com/openssl/openssl.git
synced 2024-11-27 05:21:51 +08:00
d1_lib.c,bss_dgram.c: eliminate dependency on _ftime.
This commit is contained in:
parent
bbdfbacdef
commit
f469880c61
@ -1895,11 +1895,15 @@ int BIO_dgram_non_fatal_error(int err)
|
|||||||
|
|
||||||
static void get_current_time(struct timeval *t)
|
static void get_current_time(struct timeval *t)
|
||||||
{
|
{
|
||||||
#ifdef OPENSSL_SYS_WIN32
|
#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WINCE)
|
||||||
struct _timeb tb;
|
SYSTEMTIME st;
|
||||||
_ftime(&tb);
|
union { unsigned __int64 ul; FILETIME ft; } now;
|
||||||
t->tv_sec = (long)tb.time;
|
|
||||||
t->tv_usec = (long)tb.millitm * 1000;
|
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)
|
#elif defined(OPENSSL_SYS_VMS)
|
||||||
struct timeb tb;
|
struct timeb tb;
|
||||||
ftime(&tb);
|
ftime(&tb);
|
||||||
|
14
ssl/d1_lib.c
14
ssl/d1_lib.c
@ -452,11 +452,15 @@ int dtls1_handle_timeout(SSL *s)
|
|||||||
|
|
||||||
static void get_current_time(struct timeval *t)
|
static void get_current_time(struct timeval *t)
|
||||||
{
|
{
|
||||||
#ifdef OPENSSL_SYS_WIN32
|
#if defined(OPENSSL_SYS_WIN32) || defined(OPENSSL_SYS_WINCE)
|
||||||
struct _timeb tb;
|
SYSTEMTIME st;
|
||||||
_ftime(&tb);
|
union { unsigned __int64 ul; FILETIME ft; } now;
|
||||||
t->tv_sec = (long)tb.time;
|
|
||||||
t->tv_usec = (long)tb.millitm * 1000;
|
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)
|
#elif defined(OPENSSL_SYS_VMS)
|
||||||
struct timeb tb;
|
struct timeb tb;
|
||||||
ftime(&tb);
|
ftime(&tb);
|
||||||
|
Loading…
Reference in New Issue
Block a user