summaryrefslogtreecommitdiff
path: root/source3/lib/time.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-08-24 23:39:37 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:38:52 -0500
commit94af1ad542bca6604e209b277bca40d11959b3ec (patch)
tree4ae58a42a28eb358e7a3e416993af2d1ca0c2830 /source3/lib/time.c
parentfcf90b6dceb773f1b71ca61dd10b6f793b4c4bcc (diff)
downloadsamba-94af1ad542bca6604e209b277bca40d11959b3ec.tar.gz
samba-94af1ad542bca6604e209b277bca40d11959b3ec.tar.bz2
samba-94af1ad542bca6604e209b277bca40d11959b3ec.zip
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)
Diffstat (limited to 'source3/lib/time.c')
-rw-r--r--source3/lib/time.c6
1 files changed, 3 insertions, 3 deletions
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