diff options
author | 2006-06-04 09:52:40 +0000 | |
---|---|---|
committer | 2006-06-04 09:52:40 +0000 | |
commit | 352f4d647dfa0fb6563339e41ab8acd9fb1f5691 (patch) | |
tree | e733e9b541f7fd7291cf2059613ea796fa1c56bd /sys/kern | |
parent | - we can just use the 'sizdiff' variable instead of calling strlen(expbuf); (diff) | |
download | wireguard-openbsd-352f4d647dfa0fb6563339e41ab8acd9fb1f5691.tar.xz wireguard-openbsd-352f4d647dfa0fb6563339e41ab8acd9fb1f5691.zip |
- ntpd no longer needs the NTP identifier as part of a timedelta sensor
description.
- create the timedelta sensors as early as possible, but mark them invalid
as long as there is no real data.
- update docs accordingly
Diffstat (limited to 'sys/kern')
-rw-r--r-- | sys/kern/tty_nmea.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/sys/kern/tty_nmea.c b/sys/kern/tty_nmea.c index 5a1fa9b547a..247abd00354 100644 --- a/sys/kern/tty_nmea.c +++ b/sys/kern/tty_nmea.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tty_nmea.c,v 1.3 2006/06/01 23:17:08 ckuethe Exp $ */ +/* $OpenBSD: tty_nmea.c,v 1.4 2006/06/04 09:52:40 mbalmer Exp $ */ /* * Copyright (c) 2006 Marc Balmer <mbalmer@openbsd.org> @@ -115,7 +115,8 @@ nmeaopen(dev_t dev, struct tty *tp) np->time.type = SENSOR_TIMEDELTA; np->time.value = 0LL; np->time.rfact = 0; - np->time.flags = 0; + np->time.flags = SENSOR_FINVALID; + sensor_add(&np->time); np->state = S_SYNC; np->last = 0L; } @@ -129,8 +130,7 @@ nmeaclose(struct tty *tp, int flags) struct nmea *np = (struct nmea *)tp->t_sc; tp->t_line = 0; /* switch back to termios */ - if (np->time.status != SENSOR_S_UNKNOWN) - sensor_del(&np->time); + sensor_del(&np->time); free(np, M_DEVBUF); nmea_count--; return linesw[0].l_close(tp, flags); @@ -368,8 +368,8 @@ nmea_rmc(struct nmea *np) np->time.tv.tv_sec = np->tv.tv_sec; np->time.tv.tv_usec = np->tv.tv_usec; if (np->time.status == SENSOR_S_UNKNOWN) { - strlcpy(np->time.desc, np->ti == TI_GPS ? "GPS GPS" : - "LORC Loran-C", sizeof(np->time.desc)); + strlcpy(np->time.desc, np->ti == TI_GPS ? "GPS" : + "Loran-C", sizeof(np->time.desc)); if (np->fldcnt == 12) { switch (np->cbuf[np->fpos[11]]) { case 'S': @@ -395,7 +395,7 @@ nmea_rmc(struct nmea *np) } } np->time.status = SENSOR_S_OK; - sensor_add(&np->time); + np->time.flags &= ~SENSOR_FINVALID; } switch (np->cbuf[np->fpos[1]]) { case 'A': |