diff --git a/src/usr.sbin/ntpd/ntpd.c b/src/usr.sbin/ntpd/ntpd.c index 664257ed..2998b271 100644 --- a/src/usr.sbin/ntpd/ntpd.c +++ b/src/usr.sbin/ntpd/ntpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ntpd.c,v 1.7 2004/07/07 06:57:13 henning Exp $ */ +/* $OpenBSD: ntpd.c,v 1.8 2004/07/08 15:06:43 henning Exp $ */ /* * Copyright (c) 2003, 2004 Henning Brauer @@ -91,8 +91,6 @@ main(int argc, char *argv[]) conffile = CONFFILE; bzero(&conf, sizeof(conf)); - TAILQ_INIT(&conf.listen_addrs); - TAILQ_INIT(&conf.ntp_peers); log_init(1); /* log to stderr until daemonized */ diff --git a/src/usr.sbin/ntpd/parse.y b/src/usr.sbin/ntpd/parse.y index 194dffbe..2adc473d 100644 --- a/src/usr.sbin/ntpd/parse.y +++ b/src/usr.sbin/ntpd/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.8 2004/07/08 01:22:57 henning Exp $ */ +/* $OpenBSD: parse.y,v 1.9 2004/07/08 15:06:43 henning Exp $ */ /* * Copyright (c) 2002, 2003, 2004 Henning Brauer @@ -425,11 +425,8 @@ int parse_config(char *filename, struct ntpd_conf *xconf) { struct sym *sym, *next; - struct listen_addr *la; - struct ntp_peer *p; - if ((conf = calloc(1, sizeof(struct ntpd_conf))) == NULL) - fatal(NULL); + conf = xconf; lineno = 1; errors = 0; TAILQ_INIT(&conf->listen_addrs); @@ -460,30 +457,6 @@ parse_config(char *filename, struct ntpd_conf *xconf) } } - while ((la = TAILQ_FIRST(&xconf->listen_addrs)) != NULL) { - TAILQ_REMOVE(&xconf->listen_addrs, la, entry); - free(la); - } - - while ((la = TAILQ_FIRST(&conf->listen_addrs)) != NULL) { - TAILQ_REMOVE(&conf->listen_addrs, la, entry); - TAILQ_INSERT_TAIL(&xconf->listen_addrs, la, entry); - } - - while ((p = TAILQ_FIRST(&xconf->ntp_peers)) != NULL) { - TAILQ_REMOVE(&xconf->ntp_peers, p, entry); - free(p); - } - - while ((p = TAILQ_FIRST(&conf->ntp_peers)) != NULL) { - TAILQ_REMOVE(&conf->ntp_peers, p, entry); - TAILQ_INSERT_TAIL(&xconf->ntp_peers, p, entry); - } - - xconf->listen_all = conf->listen_all; - - free(conf); - return (errors ? -1 : 0); }