I'd like to propose a subtle behavior change when the -s option is given, that allows the clock to jump directly to the new time on the first poll cycle.
Right now setmode is dropped to 1 in the end of the infinite loop, regardless of whether it had success fetching the time. This has the consequence that, if the check fails in the first attempt for whatever the reason (e.g. network not ready) and the clock is sufficiently out of sync, htpdate cannot sync it anymore.
The change proposed is to only drop mode if the check has been successful (inside if (goodtimes) {), so that we are sure at least one check has been made and we got our clock in sync
Hi there!
I'd like to propose a subtle behavior change when the
-s
option is given, that allows the clock to jump directly to the new time on the first poll cycle.Right now
setmode
is dropped to 1 in the end of the infinite loop, regardless of whether it had success fetching the time. This has the consequence that, if the check fails in the first attempt for whatever the reason (e.g. network not ready) and the clock is sufficiently out of sync, htpdate cannot sync it anymore.The change proposed is to only drop mode if the check has been successful (inside
if (goodtimes) {
), so that we are sure at least one check has been made and we got our clock in sync