ryantimwilson / rpms / systemd

Forked from rpms/systemd 2 months ago
Clone
Blob Blame History Raw
From 5c34306656dbcc8932f3dd992cf7e3e1d78c8a80 Mon Sep 17 00:00:00 2001
From: Kay Sievers <kay@vrfy.org>
Date: Tue, 15 Jul 2014 02:24:35 +0200
Subject: [PATCH] timesyncd: suppress resync at system time change when not
 connected

Jul 04 17:46:03 orchid systemd[1]: Starting Network Time Synchronization...
Jul 04 17:46:03 orchid systemd[1]: Started Network Time Synchronization.
Jul 04 17:46:22 orchid systemd-timesyncd[301]: System time changed. Resyncing.
Jul 04 17:46:22 orchid systemd-timesyncd[301]: Assertion 'm->current_server_name'

https://bugs.freedesktop.org/show_bug.cgi?id=80932
(cherry picked from commit afc7b1b9c170b9d23a3d91367e00f33b2ee2e89e)
---
 src/timesync/timesyncd.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/timesync/timesyncd.c b/src/timesync/timesyncd.c
index 27f6b2d226..9bc773ce5f 100644
--- a/src/timesync/timesyncd.c
+++ b/src/timesync/timesyncd.c
@@ -331,6 +331,9 @@ static int manager_clock_watch(sd_event_source *source, int fd, uint32_t revents
         /* rearm timer */
         manager_clock_watch_setup(m);
 
+        if (!m->current_server_address)
+                return 0;
+
         /* skip our own jumps */
         if (m->jumped) {
                 m->jumped = false;