Browse Source

urgs, other stuff snuck in

OPENBSD_4_0
henning 18 years ago
parent
commit
1110d359db
2 changed files with 2 additions and 16 deletions
  1. +1
    -14
      src/usr.sbin/ntpd/ntp.c
  2. +1
    -2
      src/usr.sbin/ntpd/sensors.c

+ 1
- 14
src/usr.sbin/ntpd/ntp.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: ntp.c,v 1.79 2006/06/01 04:42:23 henning Exp $ */
/* $OpenBSD: ntp.c,v 1.80 2006/06/01 05:44:35 henning Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -429,27 +429,18 @@ priv_adjtime(void)
int offset_cnt = 0, i = 0, j;
struct ntp_offset **offsets;
double offset_median;
u_int8_t priority = 0;
TAILQ_FOREACH(p, &conf->ntp_peers, entry) {
if (p->trustlevel < TRUSTLEVEL_BADPEER)
continue;
if (!p->update.good)
return;
if (p->priority > priority) {
priority = p->priority;
offset_cnt = 0;
}
offset_cnt += p->weight;
}
TAILQ_FOREACH(s, &conf->ntp_sensors, entry) {
if (!s->update.good)
continue;
if (s->priority > priority) {
priority = s->priority;
offset_cnt = 0;
}
offset_cnt += p->weight;
}
@ -459,8 +450,6 @@ priv_adjtime(void)
TAILQ_FOREACH(p, &conf->ntp_peers, entry) {
if (p->trustlevel < TRUSTLEVEL_BADPEER)
continue;
if (p->priority < priority)
continue;
for (j = 0; j < p->weight; j++)
offsets[i++] = &p->update;
}
@ -468,8 +457,6 @@ priv_adjtime(void)
TAILQ_FOREACH(s, &conf->ntp_sensors, entry) {
if (!s->update.good)
continue;
if (s->priority < priority)
continue;
for (j = 0; j < s->weight; j++)
offsets[i++] = &s->update;
}


+ 1
- 2
src/usr.sbin/ntpd/sensors.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: sensors.c,v 1.17 2006/06/01 04:44:23 henning Exp $ */
/* $OpenBSD: sensors.c,v 1.18 2006/06/01 05:44:35 henning Exp $ */
/*
* Copyright (c) 2006 Henning Brauer <henning@openbsd.org>
@ -102,7 +102,6 @@ sensor_add(struct sensor *sensor)
s->next = time(NULL);
s->weight = cs->weight;
s->priority = cs->priority;
if ((s->device = strdup(sensor->device)) == NULL)
fatal("sensor_add strdup");
s->sensorid = sensor->num;


Loading…
Cancel
Save