summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorKay Sievers <kay@vrfy.org>2014-03-18 03:57:35 +0100
committerKay Sievers <kay@vrfy.org>2014-03-18 03:57:35 +0100
commit12c0d47c60f4fb6f5a11c02ddb91a6c7ded5a049 (patch)
tree92dff0d348d707d80c12021ff9fbda470a704fa9 /src
parent761a7c71b649b5e926c28c703a11fbdc22dd6df1 (diff)
timedatectl: clear ADJ_MAXERROR to make sure we keep STA_SYNC set
Diffstat (limited to 'src')
-rw-r--r--src/timedate/timedate-sntp.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/timedate/timedate-sntp.c b/src/timedate/timedate-sntp.c
index 36b2a1a1a5..e4aad36cc5 100644
--- a/src/timedate/timedate-sntp.c
+++ b/src/timedate/timedate-sntp.c
@@ -347,14 +347,12 @@ static int sntp_adjust_clock(SNTPContext *sntp, double offset, int leap_sec) {
* syncs the system time periodically to the hardware clock.
*/
if (offset < NTP_MAX_ADJUST && offset > -NTP_MAX_ADJUST) {
- int constant;
-
- constant = log2i(sntp->poll_interval_usec / USEC_PER_SEC) - 6;
-
- tmx.modes |= ADJ_STATUS | ADJ_OFFSET | ADJ_TIMECONST;
+ tmx.modes |= ADJ_STATUS | ADJ_OFFSET | ADJ_TIMECONST | ADJ_MAXERROR | ADJ_ESTERROR;
tmx.status = STA_PLL;
tmx.offset = offset * 1000 * 1000;
- tmx.constant = constant;
+ tmx.constant = log2i(sntp->poll_interval_usec / USEC_PER_SEC) - 6;
+ tmx.maxerror = 0;
+ tmx.esterror = 0;
log_debug(" adjust (slew): %+f sec\n", (double)tmx.offset / USEC_PER_SEC);
} else {
tmx.modes = ADJ_SETOFFSET;