systemd/0095-timesyncd-don-t-reset-polling-interval-when-reselect.patch

33 lines
1.3 KiB
Diff
Raw Normal View History

From 4242ef948fb91a1e65e34078b25f419950fc79e8 Mon Sep 17 00:00:00 2001
From: Michal Schmidt <mschmidt@redhat.com>
Date: Wed, 10 Sep 2014 19:57:04 +0200
Subject: [PATCH] timesyncd: don't reset polling interval when reselecting
server
Upstream commit:
commit 80cd2606b91ce2735a0609c6f964917cf12685aa
Author: Kay Sievers <kay@vrfy.org>
Date: Tue Sep 2 14:33:59 2014 +0200
timesyncd: don't reset polling interval when reselecting server
Original patch from: Miroslav Lichvar <mlichvar@redhat.com>
---
src/timesync/timesyncd.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/src/timesync/timesyncd.c b/src/timesync/timesyncd.c
index 7470f4db97..19ab1cf999 100644
--- a/src/timesync/timesyncd.c
+++ b/src/timesync/timesyncd.c
@@ -800,7 +800,8 @@ static int manager_begin(Manager *m) {
assert_return(m->current_server_address, -EHOSTUNREACH);
m->missed_replies = NTP_MAX_MISSED_REPLIES;
- m->poll_interval_usec = NTP_POLL_INTERVAL_MIN_SEC * USEC_PER_SEC;
+ if (m->poll_interval_usec == 0)
+ m->poll_interval_usec = NTP_POLL_INTERVAL_MIN_SEC * USEC_PER_SEC;
sockaddr_pretty(&m->current_server_address->sockaddr.sa, m->current_server_address->socklen, true, &pretty);
log_info("Using NTP server %s (%s).", strna(pretty), m->current_server_name->string);