From 94af1ad542bca6604e209b277bca40d11959b3ec Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Thu, 24 Aug 2006 23:39:37 +0000 Subject: r17818: Fixup uint64 time calc. NT time is a 64 bit number, not high value seconds, low value 100ns units. Jeremy. (This used to be commit ead75870d5d3c690fabd131a9dd8776e854638dc) --- source3/lib/time.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'source3') diff --git a/source3/lib/time.c b/source3/lib/time.c index 7d8f79b14a..b4477d693a 100644 --- a/source3/lib/time.c +++ b/source3/lib/time.c @@ -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 -- cgit