summaryrefslogtreecommitdiff
path: root/net/openntpd/files/patch-compat_adjfreq__freebsd.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/openntpd/files/patch-compat_adjfreq__freebsd.c')
-rw-r--r--net/openntpd/files/patch-compat_adjfreq__freebsd.c23
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;
++}