2648. [port] win32: isc_time_seconds() was broken. [RT #19900]
This commit is contained in:
@@ -1,3 +1,5 @@
|
||||
2648. [port] win32: isc_time_seconds() was broken. [RT #19900]
|
||||
|
||||
2647. [bug] Remove unnecessary SOA updates when a new KSK is
|
||||
added. [RT #19913]
|
||||
|
||||
|
||||
+18
-16
@@ -15,7 +15,7 @@
|
||||
* PERFORMANCE OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
/* $Id: time.c,v 1.50 2009/07/17 23:47:41 tbox Exp $ */
|
||||
/* $Id: time.c,v 1.51 2009/08/13 03:34:10 marka Exp $ */
|
||||
|
||||
#include <config.h>
|
||||
|
||||
@@ -226,28 +226,30 @@ isc_time_microdiff(const isc_time_t *t1, const isc_time_t *t2) {
|
||||
|
||||
isc_uint32_t
|
||||
isc_time_seconds(const isc_time_t *t) {
|
||||
SYSTEMTIME st;
|
||||
SYSTEMTIME epoch = { 1970, 1, 4, 1, 0, 0, 0, 0 };
|
||||
FILETIME temp;
|
||||
ULARGE_INTEGER i1, i2;
|
||||
LONGLONG i3;
|
||||
|
||||
/*
|
||||
* Convert the time to a SYSTEMTIME structure and the grab the
|
||||
* milliseconds
|
||||
*/
|
||||
FileTimeToSystemTime(&t->absolute, &st);
|
||||
SystemTimeToFileTime(&epoch, &temp);
|
||||
|
||||
return ((isc_uint32_t)(st.wMilliseconds / 1000));
|
||||
i1.LowPart = t->absolute.dwLowDateTime;
|
||||
i1.HighPart = t->absolute.dwHighDateTime;
|
||||
i2.LowPart = temp.dwLowDateTime;
|
||||
i2.HighPart = temp.dwHighDateTime;
|
||||
|
||||
i3 = (i1.QuadPart - i2.QuadPart) / 10000000;
|
||||
|
||||
return ((isc_uint32_t)i3)
|
||||
}
|
||||
|
||||
isc_uint32_t
|
||||
isc_time_nanoseconds(const isc_time_t *t) {
|
||||
SYSTEMTIME st;
|
||||
ULARGE_INTEGER i;
|
||||
|
||||
/*
|
||||
* Convert the time to a SYSTEMTIME structure and the grab the
|
||||
* milliseconds
|
||||
*/
|
||||
FileTimeToSystemTime(&t->absolute, &st);
|
||||
|
||||
return ((isc_uint32_t)(st.wMilliseconds * 1000000));
|
||||
i.LowPart = t->absolute.dwLowDateTime;
|
||||
i.HighPart = t->absolute.dwHighDateTime;
|
||||
return ((isc_uint32_t)(i.QuadPart % 10000000) * 100);
|
||||
}
|
||||
|
||||
void
|
||||
|
||||
Reference in New Issue
Block a user