diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-02-10 13:42:29 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-02-10 13:42:29 -0500 |
commit | 0231f6359065ba49230051474f977369d5a58e95 (patch) | |
tree | b0bb0f41a5176eed0ea7937d73417b27e86ab363 /gpsmon.c | |
parent | 029b5e46b08810d0dcf65456edec877c1bda1105 (diff) | |
download | gpsd-0231f6359065ba49230051474f977369d5a58e95.tar.gz |
Fix the gpsmon display-trashing problem; add some documentation and asserts.
All regression tests pass.
Diffstat (limited to 'gpsmon.c')
-rw-r--r-- | gpsmon.c | 7 |
1 files changed, 4 insertions, 3 deletions
@@ -15,6 +15,7 @@ #include <signal.h> #include <stdarg.h> #include <time.h> +#include <math.h> #include <sys/time.h> /* expected to declare select(2) a la SuS */ #include <sys/types.h> #include <sys/stat.h> @@ -744,9 +745,9 @@ static void gpsmon_hook(struct gps_device_t *device, gps_mask_t changed UNUSED) report_unlock(); #ifdef NTPSHM_ENABLE - /* Update the last fix time seen for PPS. */ - /* FIXME! ntpshm_latch() need device->newdata.time to be set */ - ntpshm_latch(device, &td); + /* Update the last fix time seen for PPS if we've actually seen one. */ + if (!isnan(device->newdata.time)) + ntpshm_latch(device, &td); #endif /* NTPSHM_ENABLE */ } /*@+observertrans +nullpass +globstate +compdef +uniondef@*/ |