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:
parent
96325ff44d
commit
8c87a4319c
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user