do it's job it would have to choose between two cases:
1. either it would take a very long time to get the correct adjustment, thus,
if you are not currently on the net right, you wait a long time (or must
type ^C, which is ridiculous)
2. ntpd could be modified to "abort early", but then would not meet the
promise made by -s in the manual page (note: it does not say that it
"tries")
therefore, -s and -S must become user choices. Sorry. This same choice is
made in lots of other places
when those timers are actually running. due to the way ntpd's logic works
this does not really make a difference, but correctness is good.
spotted by me, joerg agrees
- Handle errors from syscalls better
- Prevent curtime.tv_usec from being negative for negative offsets.
- Don't claim to have done settimeofday if it fails.
ok henning@
there are some bytes left (less than an imsg header, or less than the
imsg header len field says) we copy it to the very beginning of the buffer.
use memmove instead of memcpy since it is not guaranteed that there's no
overlap. while memcpy on OpenBSD is safe, it might not elsewhere, and
we want our code to be correct anyways.
funny enough theo and I talked at length about that last week in dublin,
and I said I believe I had no memcpys with the chance of overlap in ntpd/bgpd -
well, here is one, and Alexander von Gernler <grunk@pestilenz.org> pointed
me to it.
do so when
-we tried to send at least one query (that is the change)
-we could not send ou a single one without failure (this was already in
place but catched too much)
problem independently noticed by nick and danh, ok mickey danh, testing by
many
move log_debug call to tell about skipping the settime due to lack of
answers down slightly below the 2nd (and final) log_init call so it becomes
a -d only thing. tested by dlg and me
a reply to that query.
if we get errors for all queries and the initial settime() is still due
and thus the parent process still waits (not yet daemonized!), send an
IMSG_SETTIME with offset 0.
shortens the delay dramatically when you boot without network
idea from a discussion with theo