diff options
author | Christian Weisgerber <naddy@FreeBSD.org> | 2015-04-30 15:17:20 +0000 |
---|---|---|
committer | Christian Weisgerber <naddy@FreeBSD.org> | 2015-04-30 15:17:20 +0000 |
commit | 655ea3bd7b67e58b555bc1bfdff8070d9f24e3b9 (patch) | |
tree | d93b6ebcbed0b23b572d042d2024bcda32263ff9 /net/openntpd/files/patch-compat_adjfreq__freebsd.c | |
parent | Disable PCH when compiler is GCC to unbreak builds on 8.x and 9.x (diff) |
Clear the timex UNSYNC flag so the RTC receives updates from the
system clock.
Diffstat (limited to 'net/openntpd/files/patch-compat_adjfreq__freebsd.c')
-rw-r--r-- | net/openntpd/files/patch-compat_adjfreq__freebsd.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/net/openntpd/files/patch-compat_adjfreq__freebsd.c b/net/openntpd/files/patch-compat_adjfreq__freebsd.c new file mode 100644 index 000000000000..e0e881df87fb --- /dev/null +++ b/net/openntpd/files/patch-compat_adjfreq__freebsd.c @@ -0,0 +1,23 @@ +--- compat/adjfreq_freebsd.c.orig 2015-03-12 04:42:13 UTC ++++ compat/adjfreq_freebsd.c +@@ -57,3 +57,20 @@ adjfreq(const int64_t *freq, int64_t *ol + + return 0; + } ++ ++/* ++ * The RTC is only updated if the clock is not marked as unsynced. ++ */ ++ ++void ++update_status(int synced) ++{ ++ struct timex txc = { 0 }; ++ ++ txc.modes = MOD_STATUS; ++ if (!synced) ++ txc.status = STA_UNSYNC; ++ if (ntp_adjtime(&txc) == -1) ++ log_warn("ntp_adjtime (3) failed"); ++ return; ++} |