r17818: Fixup uint64 time calc. NT time is a 64 bit number,
authorJeremy Allison <jra@samba.org>
Thu, 24 Aug 2006 23:39:37 +0000 (23:39 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 16:38:52 +0000 (11:38 -0500)
not high value seconds, low value 100ns units.
Jeremy.
(This used to be commit ead75870d5d3c690fabd131a9dd8776e854638dc)

source3/lib/time.c

index 7d8f79b14a9ead31d5dfd158e3de7ce3bcd72403..b4477d693ac30d23b4f8960abac451ef8d8926f6 100644 (file)
@@ -316,12 +316,12 @@ void unix_timespec_to_nt_time(NTTIME *nt, struct timespec ts)
 
        d = ts.tv_sec;
        d += TIME_FIXUP_CONSTANT_INT;
-       d = ts.tv_sec * 1000*1000*10;
+       d *= 1000*1000*10;
        /* d is now in 100ns units. */
        d += (ts.tv_nsec / 100);
 
-       nt->high = (uint32)(d / 1000*1000*10);
-       nt->low  = (uint32)(d % 1000*1000*10);
+       nt->low = (uint32)(d & 0xFFFFFFFF);
+       nt->high = (uint32)(d >> 32 );
 }
 
 #else