1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-24 21:34:56 +03:00

Fix bug #5531 - fix conversion of ns units when converting from nttime to timespec.

Fix from hkurma@datadomain.com.
Jeremy.
This commit is contained in:
Jeremy Allison 2008-06-20 13:23:31 -07:00
parent 96325ff44d
commit 8c87a4319c

View File

@ -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;