ntpd:support adjusting initial time >= y2k36 on 32-bit time_t platforms

2015-03-21 Thread Brent Cook
This came up in the OpenNTPD issue tracker: https://github.com/openntpd-portable/openntpd-openbsd/pull/4 The issue is an overflow when calculating time offsets with a 32-bit time_t in early 2036. The main reason to fix it in now, in 2015, is that OpenNTPD fails to adjust time if such a system simp

Re: ntpd:support adjusting initial time >= y2k36 on 32-bit time_t platforms

2015-03-23 Thread Alexey Suslikov
Brent Cook gmail.com> writes: > + T4 += (uint64_t)tv.tv_sec + JAN_1970 + 1.0e-6 * tv.tv_usec; > + return ((uint64_t)tv.tv_sec + JAN_1970 + 1.0e-6 * tv.tv_usec); Can gettime_from_timeval be used over the code instead of repeating same chunk? T4 += gettime_from_timev

Re: ntpd:support adjusting initial time >= y2k36 on 32-bit time_t platforms

2015-03-27 Thread Brent Cook
On Mon, Mar 23, 2015 at 10:42 AM, Alexey Suslikov wrote: > Brent Cook gmail.com> writes: > >> + T4 += (uint64_t)tv.tv_sec + JAN_1970 + 1.0e-6 * > tv.tv_usec; > > > >> + return ((uint64_t)tv.tv_sec + JAN_1970 + 1.0e-6 * tv.tv_usec); > > > > Can gettime_from_timeval be use