git.samba.org
/
metze
/
samba
/
wip.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2a4b8fa
)
Fix bug #5531 - fix conversion of ns units when converting from nttime to timespec.
author
Jeremy Allison
<jra@samba.org>
Fri, 20 Jun 2008 20:23:31 +0000
(13:23 -0700)
committer
Jeremy Allison
<jra@samba.org>
Fri, 20 Jun 2008 20:23:31 +0000
(13:23 -0700)
Fix from hkurma@datadomain.com.
Jeremy.
(This used to be commit
8c87a4319cc83f55fb105cae81a8efbc3fb5b98b
)
source3/lib/time.c
patch
|
blob
|
history
diff --git
a/source3/lib/time.c
b/source3/lib/time.c
index e5fd929d0f3a9af3d326f377361af70e5f3b9c8f..17990b926996798109a3a83f5927cd0fda17dced 100644
(file)
--- a/
source3/lib/time.c
+++ b/
source3/lib/time.c
@@
-1211,8
+1211,12
@@
struct timespec nt_time_to_unix_timespec(NTTIME *nt)
d = (int64)*nt;
/* d is now in 100ns units, since jan 1st 1601".
Save off the ns fraction. */
-
- ret.tv_nsec = (long) ((d % 100) * 100);
+
+ /*
+ * Take the last seven decimal digits and multiply by 100.
+ * to convert from 100ns units to 1ns units.
+ */
+ ret.tv_nsec = (long) ((d % (1000 * 1000 * 10)) * 100);
/* Convert to seconds */
d /= 1000*1000*10;