[chrony-dev] macOS 10.13 with netbsd driver |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-dev Archives
]
- To: chrony-dev@xxxxxxxxxxxxxxxxxxxx
- Subject: [chrony-dev] macOS 10.13 with netbsd driver
- From: Bryan Christianson <bryan@xxxxxxxxxxxxx>
- Date: Wed, 9 Aug 2017 00:23:06 +1200
- Dkim-signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=smtpcorp.com; s=a1-4; h=Feedback-ID:X-Smtpcorp-Track:To:Date:Message-Id: Subject:From:Reply-To:Sender:List-Unsubscribe; bh=YZ/X2O7Tlx7NUUN9RsqjAA5nMPHdenkRlishMkr5Ywo=; b=kz4z6gby5q25v78IbjeBsslrwf XOUQ5yxxFOV129Wk2oDLVFMPb5ulviFr2ZAQmv3kdHwbtNZZuuKySLHzBNr6z6+wFmFQqk5Hv3Inr z3Q9ceGy5Ku+SX3RVWWxpo5HnHA2zSr/2hFPigW7dp1+K3la1S8J8pQ1Mupg4PasN/ZLlZTYja49o JBbrdrmQ4SDjk/V0p9nvdXKVKr1L7Vme+e/kMUSmxxmWSAV3trM5ceU2hzQWtO9Dx5D12E/ndrmNj Wmtr1Zw1l0k0c762LnbvUZZwNFLKLUYXGxNyeLqs7FlFDpjwBwBB4zy2wAbMPhu0eZoZeVzXxdrg0 FuFsNvvg==;
- Feedback-id: 149811m:149811acx33YQ:149811sEVe0CE6FW:SMTPCORP
I stopped chronyd, then advanced the local clock by about 10 seconds. When I restarted chronyd it hit a fatal error with adjtime().
I put this patch in to correct the problem but thought I should discuss with you before submission. I'm wondering if it might be better to patch PRV_AdjustTime so that on macOS we can always handle a NULL argument.
With this patch, the frequency jumped up to 2500 ppm until the local offset was below 1 second. It then dropped back to its usual value and the system converged as normal.
number9:chrony bryan$ git diff
diff --git a/sys_netbsd.c b/sys_netbsd.c
index ba66b12..226b4eb 100644
--- a/sys_netbsd.c
+++ b/sys_netbsd.c
@@ -84,9 +84,18 @@ get_offset_correction(struct timespec *raw,
{
struct timeval remadj;
double adjustment_remaining;
+#ifdef MACOSX
+ struct timeval t1 = {0, 0};
+ if (PRV_AdjustTime(&t1, &remadj) < 0)
+ LOG_FATAL("adjtime() failed");
+
+ if (PRV_AdjustTime(&remadj, NULL) < 0)
+ LOG_FATAL("adjtime() failed");
+#else
if (PRV_AdjustTime(NULL, &remadj) < 0)
LOG_FATAL("adjtime() failed");
+#endif
adjustment_remaining = UTI_TimevalToDouble(&remadj);
Bryan Christianson
bryan@xxxxxxxxxxxxx
--
To unsubscribe email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "unsubscribe" in the subject.
For help email chrony-dev-request@xxxxxxxxxxxxxxxxxxxx with "help" in the subject.
Trouble? Email listmaster@xxxxxxxxxxxxxxxxxxxx.