summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2016-04-05 14:28:14 -0700
committerGary E. Miller <gem@rellim.com>2016-04-05 14:28:14 -0700
commitb82cc253da1de5c9beb4674a2e7f855aaea010e5 (patch)
tree470c13341100967baee00fef19614174e03c8399
parente30203491a842d63254db19fe261971f98c50a36 (diff)
downloadgpsd-b82cc253da1de5c9beb4674a2e7f855aaea010e5.tar.gz
Bad NMEA time was still leaking, require 3 fixes for time.
-rw-r--r--gpsd.c2
-rw-r--r--ppsthread.h2
-rw-r--r--timehint.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/gpsd.c b/gpsd.c
index 9d2853d3..2381e17c 100644
--- a/gpsd.c
+++ b/gpsd.c
@@ -1517,7 +1517,7 @@ static void all_reports(struct gps_device_t *device, gps_mask_t changed)
*/
if ((changed & TIME_SET) == 0) {
//gpsd_log(&context.errout, LOG_PROG, "NTP: No time this packet\n");
- } else if ( 0 >= device->fixcnt &&
+ } else if ( PPS_MIN_FIXES > device->fixcnt &&
(changed & GOODTIME_IS) == 0) {
/* many GPS spew random times until a valid GPS fix */
//gpsd_log(&context.errout, LOG_PROG, "NTP: no fix\n");
diff --git a/ppsthread.h b/ppsthread.h
index b37e739c..7c3c5d65 100644
--- a/ppsthread.h
+++ b/ppsthread.h
@@ -16,6 +16,8 @@ struct timedelta_t {
};
#endif /* TIMEDELTA_DEFINED */
+#define PPS_MIN_FIXES 3 /* # fixes to wait for before shipping NTP time */
+
/*
* Set context, devicefd, and devicename at initialization time, before
* you call pps_thread_activate(). The context pointer can be used to
diff --git a/timehint.c b/timehint.c
index c224d767..b37ea78b 100644
--- a/timehint.c
+++ b/timehint.c
@@ -105,8 +105,6 @@
* garbage-collects them when they have no attached processes.
*/
-#define PPS_MIN_FIXES 3 /* # fixes to wait for before shipping PPS */
-
static volatile struct shmTime *getShmTime(struct gps_context_t *context, int unit)
{
int shmid;