summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorckuethe <ckuethe@openbsd.org>2006-11-30 18:42:41 +0000
committerckuethe <ckuethe@openbsd.org>2006-11-30 18:42:41 +0000
commitc72e2a3d0b04d74f610eb47d17bf4f2b9fa266d0 (patch)
treee2734beed769decbe34c51a1a67e621a7a2c6e81
parentfix PHY initialization for ZD1211B. (diff)
downloadwireguard-openbsd-c72e2a3d0b04d74f610eb47d17bf4f2b9fa266d0.tar.xz
wireguard-openbsd-c72e2a3d0b04d74f610eb47d17bf4f2b9fa266d0.zip
Allow sensors in a sensors-only configuration to set the time at startup.
-rw-r--r--usr.sbin/ntpd/ntp.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/ntpd/ntp.c b/usr.sbin/ntpd/ntp.c
index 6b81c08805e..7a2c307bb7c 100644
--- a/usr.sbin/ntpd/ntp.c
+++ b/usr.sbin/ntpd/ntp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ntp.c,v 1.94 2006/10/27 12:22:41 henning Exp $ */
+/* $OpenBSD: ntp.c,v 1.95 2006/11/30 18:42:41 ckuethe Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -257,6 +257,8 @@ ntp_main(int pipe_prnt[2], struct ntpd_conf *nconf)
}
sensors_cnt = 0;
TAILQ_FOREACH(s, &conf->ntp_sensors, entry) {
+ if (conf->settime && s->offsets[0].offset)
+ priv_settime(s->offsets[0].offset);
sensors_cnt++;
if (s->next > 0 && s->next < nextaction)
nextaction = s->next;