mirror of
https://git.openafs.org/openafs.git
synced 2025-01-19 15:30:14 +00:00
Windows; GetSystemTimeAsFileTime
As per Raymond Chen's "The Old New Thing" blog http://blogs.msdn.com/b/oldnewthing/archive/2013/11/01/10462403.aspx Calling GetSystemTime() followed by SystemTimeToFileTime() performs two format translations which can be avoided by using GetSystemTimeAsFileTime() directly. Change-Id: I3d3de0e045777c9dfdb1c1f4503bfdfe19fb7b73 Reviewed-on: http://gerrit.openafs.org/10430 Tested-by: BuildBot <buildbot@rampaginggeek.com> Reviewed-by: Jeffrey Altman <jaltman@your-file-system.com>
This commit is contained in:
parent
3f5f3013e9
commit
727e951d8c
@ -197,7 +197,6 @@ void osi_Init(void)
|
|||||||
static osi_once_t once;
|
static osi_once_t once;
|
||||||
unsigned long remainder; /* for division output */
|
unsigned long remainder; /* for division output */
|
||||||
osi_fdType_t *typep;
|
osi_fdType_t *typep;
|
||||||
SYSTEMTIME sysTime;
|
|
||||||
FILETIME fileTime;
|
FILETIME fileTime;
|
||||||
osi_hyper_t bootTime;
|
osi_hyper_t bootTime;
|
||||||
|
|
||||||
@ -206,8 +205,7 @@ void osi_Init(void)
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
/* setup boot time values */
|
/* setup boot time values */
|
||||||
GetSystemTime(&sysTime);
|
GetSystemTimeAsFileTime(&fileTime);
|
||||||
SystemTimeToFileTime(&sysTime, &fileTime);
|
|
||||||
|
|
||||||
/* change the base of the time so it won't be negative for a long time */
|
/* change the base of the time so it won't be negative for a long time */
|
||||||
fileTime.dwHighDateTime -= 28000000;
|
fileTime.dwHighDateTime -= 28000000;
|
||||||
@ -708,13 +706,11 @@ void osi_panic(char *msgp, char *filep, long line)
|
|||||||
time_t osi_Time(void)
|
time_t osi_Time(void)
|
||||||
{
|
{
|
||||||
FILETIME fileTime;
|
FILETIME fileTime;
|
||||||
SYSTEMTIME sysTime;
|
|
||||||
unsigned long remainder;
|
unsigned long remainder;
|
||||||
LARGE_INTEGER bootTime;
|
LARGE_INTEGER bootTime;
|
||||||
|
|
||||||
/* setup boot time values */
|
/* setup boot time values */
|
||||||
GetSystemTime(&sysTime);
|
GetSystemTimeAsFileTime(&fileTime);
|
||||||
SystemTimeToFileTime(&sysTime, &fileTime);
|
|
||||||
|
|
||||||
/* change the base of the time so it won't be negative for a long time */
|
/* change the base of the time so it won't be negative for a long time */
|
||||||
fileTime.dwHighDateTime -= 28000000;
|
fileTime.dwHighDateTime -= 28000000;
|
||||||
@ -737,13 +733,11 @@ time_t osi_Time(void)
|
|||||||
void osi_GetTime(long *timesp)
|
void osi_GetTime(long *timesp)
|
||||||
{
|
{
|
||||||
FILETIME fileTime;
|
FILETIME fileTime;
|
||||||
SYSTEMTIME sysTime;
|
|
||||||
unsigned long remainder;
|
unsigned long remainder;
|
||||||
LARGE_INTEGER bootTime;
|
LARGE_INTEGER bootTime;
|
||||||
|
|
||||||
/* setup boot time values */
|
/* setup boot time values */
|
||||||
GetSystemTime(&sysTime);
|
GetSystemTimeAsFileTime(&fileTime);
|
||||||
SystemTimeToFileTime(&sysTime, &fileTime);
|
|
||||||
|
|
||||||
/* change the base of the time so it won't be negative for a long time */
|
/* change the base of the time so it won't be negative for a long time */
|
||||||
fileTime.dwHighDateTime -= 28000000;
|
fileTime.dwHighDateTime -= 28000000;
|
||||||
|
Loading…
Reference in New Issue
Block a user