summaryrefslogtreecommitdiff
path: root/usr.sbin/ntpd/config.c
diff options
context:
space:
mode:
authorHenning Brauer <henning@cvs.openbsd.org>2006-05-27 17:01:08 +0000
committerHenning Brauer <henning@cvs.openbsd.org>2006-05-27 17:01:08 +0000
commit954bd17cbd282d896c77f38d0772b325d0081e00 (patch)
tree6fa98e7aacf2506d58c4340ba36abb1c101d424d /usr.sbin/ntpd/config.c
parentb04951fd6041422bc43a447d598fa8479c25635d (diff)
config file bits for timedelta sensors, so one can specify which devices
to use. "sensors *" just uses all. untested due to lack of hardware. hacked on the road somewhere between vancouver and calgary
Diffstat (limited to 'usr.sbin/ntpd/config.c')
-rw-r--r--usr.sbin/ntpd/config.c17
1 files changed, 15 insertions, 2 deletions
diff --git a/usr.sbin/ntpd/config.c b/usr.sbin/ntpd/config.c
index f36bc6274d9..b95df25b8c7 100644
--- a/usr.sbin/ntpd/config.c
+++ b/usr.sbin/ntpd/config.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: config.c,v 1.18 2005/05/11 15:12:35 henning Exp $ */
+/* $OpenBSD: config.c,v 1.19 2006/05/27 17:01:07 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@@ -167,8 +167,21 @@ new_peer(void)
struct ntp_peer *p;
if ((p = calloc(1, sizeof(struct ntp_peer))) == NULL)
- fatal("conf_main server calloc");
+ fatal("new_peer calloc");
p->id = ++maxid;
return (p);
}
+
+struct ntp_conf_sensor *
+new_sensor(char *device)
+{
+ struct ntp_conf_sensor *s;
+
+ if ((s = calloc(1, sizeof(struct ntp_conf_sensor))) == NULL)
+ fatal("new_sensor calloc");
+ if ((s->device = strdup(device)) == NULL)
+ fatal("new_sensor strdup");
+
+ return (s);
+}