]> git.ipfire.org Git - thirdparty/chrony.git/commit
client: avoid reading clock after sending request
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 12 Dec 2017 10:03:04 +0000 (11:03 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 12 Dec 2017 10:37:36 +0000 (11:37 +0100)
commit6863e43269fe27ce2744eb643295f31c00ec176d
tree1d07d0ea49966d7bd94e43b28729eff1555aa232
parentde8708f331f2853fe6d349ab8e4ec8930f2b7276
client: avoid reading clock after sending request

If chronyc sent a request which caused chronyd to step the clock (e.g.
makestep, settime) and the second reading of the clock before calling
select() to wait for a response happened after the clock was stepped, a
new request could be sent immediately and chronyd would process the same
command twice. If the second request failed (e.g. a settime request too
close to the first request), chronyc would report an error.

Change the submit_request() function to read the clock only once per
select() to wait for the first response even when the clock was stepped.
client.c