[chrony-dev] [PATCH] Remove adjtime() check. |
[ Thread Index |
Date Index
| More chrony.tuxfamily.org/chrony-dev Archives
]
- To: chrony-dev@xxxxxxxxxxxxxxxxxxxx
- Subject: [chrony-dev] [PATCH] Remove adjtime() check.
- From: Bryan Christianson <bryan@xxxxxxxxxxxxx>
- Date: Tue, 2 Oct 2018 10:40:27 +1300
- Cc: Bryan Christianson <bryan@xxxxxxxxxxxxx>
- 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:Message-Id:Date: Subject:To:From:Reply-To:Sender:List-Unsubscribe; bh=QcDjIdiSex8DJ0pRg9Ela2Xzs7/xWOIObfovR/cIOZU=; b=j2HPZNk9+Ilau9+OHwVbBH2cB5 mPycrVGPVizbhASQLRb2XFuYHnaHBqUovEATdmF+Ni4l0jmMvO480NirGhrRxG9MyL1hHvqyXcpm0 MYWeFSzZVSbikTo0Inyc6GyVJ7FO7x4MTkXRlncZsaOHnv7XbJdekOxVrx5cMmPEF5nP4cz5IIfrh CtWyGpHo/k9tJisZl4m9ps6dtBdrHxLacOod052mIX/TkkECL3nu7e/DfK1Wp+8PCPJNzKqGLbGIR nSgyHDS0PqFlykLYTw44/ws42B9Vfj9RxNx4J1+vtKYuXaBR3VbgsBq77nGQONR/6GO0e4S+dW/o9 jwhE0Wcw==;
- Feedback-id: 149811m:149811acx33YQ:149811sPY2stou01
Remove the runtime checking of adjtime(). adjtime() was broken in beta releases of macOS 10.13 but is ok now.
---
sys_macosx.c | 42 ++----------------------------------------
1 file changed, 2 insertions(+), 40 deletions(-)
diff --git a/sys_macosx.c b/sys_macosx.c
index 00ce302..807d62e 100644
--- a/sys_macosx.c
+++ b/sys_macosx.c
@@ -49,10 +49,8 @@
#ifdef HAVE_MACOS_SYS_TIMEX
#include <dlfcn.h>
#include "sys_netbsd.h"
-#include "sys_timex.h"
static int have_ntp_adjtime = 0;
-static int have_bad_adjtime = 0;
#endif
/* ================================================== */
@@ -453,45 +451,13 @@ legacy_MacOSX_Finalise(void)
/* ================================================== */
-#ifdef HAVE_MACOS_SYS_TIMEX
-/*
- Test adjtime() to see if Apple have fixed the signed/unsigned bug
-*/
-static int
-test_adjtime()
-{
- struct timeval tv1 = {-1, 0};
- struct timeval tv2 = {0, 0};
- struct timeval tv;
-
- if (PRV_AdjustTime(&tv1, &tv) != 0) {
- return 0;
- }
- if (PRV_AdjustTime(&tv2, &tv) != 0) {
- return 0;
- }
- if (tv.tv_sec < -1 || tv.tv_sec > 1) {
- return 0;
- }
- return 1;
-}
-#endif
-
-/* ================================================== */
-
void
SYS_MacOSX_Initialise(void)
{
#ifdef HAVE_MACOS_SYS_TIMEX
have_ntp_adjtime = (dlsym(RTLD_NEXT, "ntp_adjtime") != NULL);
if (have_ntp_adjtime) {
- have_bad_adjtime = !test_adjtime();
- if (have_bad_adjtime) {
- LOG(LOGS_WARN, "adjtime() is buggy - using timex driver");
- SYS_Timex_Initialise();
- } else {
- SYS_NetBSD_Initialise();
- }
+ SYS_NetBSD_Initialise();
return;
}
#endif
@@ -505,11 +471,7 @@ SYS_MacOSX_Finalise(void)
{
#ifdef HAVE_MACOS_SYS_TIMEX
if (have_ntp_adjtime) {
- if (have_bad_adjtime) {
- SYS_Timex_Finalise();
- } else {
- SYS_NetBSD_Finalise();
- }
+ SYS_NetBSD_Finalise();
return;
}
#endif
--
2.17.1 (Apple Git-112)
--
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.