teknoraver / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone

Blame 0008-timesyncd-remove-retry_timer-logic-which-is-covered-.patch

Michal Schmidt d962ba
From aebe463f08041d5c38023b414153a79295a5457f Mon Sep 17 00:00:00 2001
Michal Schmidt d962ba
From: Kay Sievers <kay@vrfy.org>
Michal Schmidt d962ba
Date: Tue, 2 Sep 2014 14:27:00 +0200
Michal Schmidt d962ba
Subject: [PATCH 08/12] timesyncd: remove retry_timer logic which is covered by
Michal Schmidt d962ba
 the server timeout
Michal Schmidt d962ba
Michal Schmidt d962ba
(cherry picked from commit 665c6a9eab46b0b253af6566ca9fc70c866b3fcd)
Michal Schmidt d962ba
---
Michal Schmidt d962ba
 src/timesync/timesyncd-manager.c | 14 --------------
Michal Schmidt d962ba
 src/timesync/timesyncd-manager.h |  1 -
Michal Schmidt d962ba
 2 files changed, 15 deletions(-)
Michal Schmidt d962ba
Michal Schmidt d962ba
diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c
Michal Schmidt d962ba
index b7b39ef..19a28f3 100644
Michal Schmidt d962ba
--- a/src/timesync/timesyncd-manager.c
Michal Schmidt d962ba
+++ b/src/timesync/timesyncd-manager.c
Michal Schmidt d962ba
@@ -206,19 +206,6 @@ static int manager_send_request(Manager *m) {
Michal Schmidt d962ba
                 return manager_connect(m);
Michal Schmidt d962ba
         }
Michal Schmidt d962ba
 
Michal Schmidt d962ba
-        /* re-arm timer with increasing timeout, in case the packets never arrive back */
Michal Schmidt d962ba
-        if (m->retry_interval > 0) {
Michal Schmidt d962ba
-                if (m->retry_interval < NTP_POLL_INTERVAL_MAX_SEC * USEC_PER_SEC)
Michal Schmidt d962ba
-                        m->retry_interval *= 2;
Michal Schmidt d962ba
-        } else
Michal Schmidt d962ba
-                m->retry_interval = NTP_POLL_INTERVAL_MIN_SEC * USEC_PER_SEC;
Michal Schmidt d962ba
-
Michal Schmidt d962ba
-        r = manager_arm_timer(m, m->retry_interval);
Michal Schmidt d962ba
-        if (r < 0) {
Michal Schmidt d962ba
-                log_error("Failed to rearm timer: %s", strerror(-r));
Michal Schmidt d962ba
-                return r;
Michal Schmidt d962ba
-        }
Michal Schmidt d962ba
-
Michal Schmidt d962ba
         r = sd_event_add_time(
Michal Schmidt d962ba
                         m->event,
Michal Schmidt d962ba
                         &m->event_timeout,
Michal Schmidt d962ba
@@ -601,7 +588,6 @@ static int manager_receive_response(sd_event_source *source, int fd, uint32_t re
Michal Schmidt d962ba
 
Michal Schmidt d962ba
         /* valid packet */
Michal Schmidt d962ba
         m->pending = false;
Michal Schmidt d962ba
-        m->retry_interval = 0;
Michal Schmidt d962ba
 
Michal Schmidt d962ba
         /* announce leap seconds */
Michal Schmidt d962ba
         if (NTP_FIELD_LEAP(ntpmsg.field) & NTP_LEAP_PLUSSEC)
Michal Schmidt d962ba
diff --git a/src/timesync/timesyncd-manager.h b/src/timesync/timesyncd-manager.h
Michal Schmidt d962ba
index bb3e509..0ac0e17 100644
Michal Schmidt d962ba
--- a/src/timesync/timesyncd-manager.h
Michal Schmidt d962ba
+++ b/src/timesync/timesyncd-manager.h
Michal Schmidt d962ba
@@ -59,7 +59,6 @@ struct Manager {
Michal Schmidt d962ba
         /* last sent packet */
Michal Schmidt d962ba
         struct timespec trans_time_mon;
Michal Schmidt d962ba
         struct timespec trans_time;
Michal Schmidt d962ba
-        usec_t retry_interval;
Michal Schmidt d962ba
         bool pending;
Michal Schmidt d962ba
 
Michal Schmidt d962ba
         /* poll timer */
Michal Schmidt d962ba
-- 
Michal Schmidt d962ba
2.1.0
Michal Schmidt d962ba