Browse Source

rename refstr to refid since it is an int32; ok henning

OPENBSD_4_4
deraadt 16 years ago
parent
commit
52e9696746
2 changed files with 10 additions and 10 deletions
  1. +2
    -2
      src/usr.sbin/ntpd/ntpd.h
  2. +8
    -8
      src/usr.sbin/ntpd/sensors.c

+ 2
- 2
src/usr.sbin/ntpd/ntpd.h View File

@ -1,4 +1,4 @@
/* $OpenBSD: ntpd.h,v 1.93 2008/06/09 16:37:35 ckuethe Exp $ */
/* $OpenBSD: ntpd.h,v 1.94 2008/06/09 18:30:48 deraadt Exp $ */
/*
* Copyright (c) 2003, 2004 Henning Brauer <henning@openbsd.org>
@ -140,7 +140,7 @@ struct ntp_sensor {
time_t next;
time_t last;
char *device;
u_int32_t refstr;
u_int32_t refid;
int sensordevid;
int correction;
u_int8_t weight;


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

@ -1,4 +1,4 @@
/* $OpenBSD: sensors.c,v 1.38 2008/06/09 18:30:03 deraadt Exp $ */
/* $OpenBSD: sensors.c,v 1.39 2008/06/09 18:30:48 deraadt Exp $ */
/*
* Copyright (c) 2006 Henning Brauer <henning@openbsd.org>
@ -128,17 +128,17 @@ sensor_add(int sensordev, char *dxname)
s->sensordevid = sensordev;
if (cs->refstr == NULL)
memcpy(&s->refstr, "HARD", sizeof(s->refstr));
memcpy(&s->refid, "HARD", sizeof(s->refid));
else {
s->refstr = 0;
strncpy((char *)&s->refstr, cs->refstr, sizeof(s->refstr));
s->refid = 0;
strncpy((char *)&s->refid, cs->refstr, sizeof(s->refid));
}
TAILQ_INSERT_TAIL(&conf->ntp_sensors, s, entry);
log_debug("sensor %s added (weight %d, correction %.6f, refstr %-4s)",
s->device, s->weight, s->correction / 1e6, &s->refstr);
s->refstr = htonl(s->refstr);
s->device, s->weight, s->correction / 1e6, &s->refid);
s->refid = htonl(s->refid);
}
void
@ -190,8 +190,8 @@ sensor_query(struct ntp_sensor *s)
s->offsets[s->shift].rcvd = sensor.tv.tv_sec;
s->offsets[s->shift].good = 1;
s->offsets[s->shift].status.refid = s->refstr;
s->offsets[s->shift].status.refid4 = s->refstr;
s->offsets[s->shift].status.refid = s->refid;
s->offsets[s->shift].status.refid4 = s->refid;
s->offsets[s->shift].status.stratum = 0; /* increased when sent out */
s->offsets[s->shift].status.rootdelay = 0;
s->offsets[s->shift].status.rootdispersion = 0;


Loading…
Cancel
Save