mirror of
https://git.freebsd.org/ports.git
synced 2025-05-24 15:07:01 -04:00
Clear the timex UNSYNC flag so the RTC receives updates from the
system clock.
This commit is contained in:
parent
8fe6ad9b9c
commit
655ea3bd7b
Notes:
svn2git
2021-03-31 03:12:20 +00:00
svn path=/head/; revision=385051
3 changed files with 42 additions and 0 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
PORTNAME= openntpd
|
||||
PORTVERSION= 5.7p4
|
||||
PORTREVISION= 1
|
||||
PORTEPOCH= 2
|
||||
CATEGORIES= net
|
||||
MASTER_SITES= ${MASTER_SITE_OPENBSD}
|
||||
|
|
23
net/openntpd/files/patch-compat_adjfreq__freebsd.c
Normal file
23
net/openntpd/files/patch-compat_adjfreq__freebsd.c
Normal file
|
@ -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;
|
||||
+}
|
18
net/openntpd/files/patch-src_ntpd.c
Normal file
18
net/openntpd/files/patch-src_ntpd.c
Normal file
|
@ -0,0 +1,18 @@
|
|||
--- src/ntpd.c.orig 2015-03-25 01:18:56 UTC
|
||||
+++ src/ntpd.c
|
||||
@@ -53,6 +53,7 @@ const char *ctl_lookup_option(char *
|
||||
void show_status_msg(struct imsg *);
|
||||
void show_peer_msg(struct imsg *, int);
|
||||
void show_sensor_msg(struct imsg *, int);
|
||||
+void update_status(int);
|
||||
|
||||
volatile sig_atomic_t quit = 0;
|
||||
volatile sig_atomic_t reconfig = 0;
|
||||
@@ -423,6 +424,7 @@ ntpd_adjtime(double d)
|
||||
else if (!firstadj && olddelta.tv_sec == 0 && olddelta.tv_usec == 0)
|
||||
synced = 1;
|
||||
firstadj = 0;
|
||||
+ update_status(synced);
|
||||
return (synced);
|
||||
}
|
||||
|
Loading…
Add table
Reference in a new issue