From 4f7a418117473b91a01ceac4cb9aeb683734931f Mon Sep 17 00:00:00 2001 From: Daniel Thompson Date: Sat, 21 Oct 2017 08:54:23 -0600 Subject: [PATCH] Added minor minor additions/changes to lines 117-119 of NTPClient.swift in the project which we initially made to fix the ability to update TrueTime on a regular interval. All other changes we initially made to the code have already been implemented in the latest version of the project we pulled from the repository (such as: removing "let" from line 117 of NTPClient.swift; and changing line 62 of NTPExtensions.swift from "UInt64(time.tv_sec + secondsFrom1900To1970)" to UInt64(time.tv_sec) + UInt64(secondsFrom1900To1970)" to resolve an xCode warning). --- Sources/NTPClient.swift | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Sources/NTPClient.swift b/Sources/NTPClient.swift index 14b8e8a..c478f71 100644 --- a/Sources/NTPClient.swift +++ b/Sources/NTPClient.swift @@ -114,9 +114,9 @@ private extension NTPClient { if let referenceTime = referenceTime { let remainingInterval = max(0, config.pollInterval - referenceTime.underlyingValue.uptimeInterval) - timer = DispatchSource.makeTimerSource(flags: [], queue: queue) - timer?.setEventHandler(handler: invalidate) + timer = DispatchSource.makeTimerSource(flags: [], queue: queue) as? DispatchSource timer?.schedule(deadline: .now() + remainingInterval) + timer?.setEventHandler(handler: invalidate) timer?.resume() } }