summaryrefslogtreecommitdiff
path: root/gpsmon.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-02-10 13:42:29 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-02-10 13:42:29 -0500
commit0231f6359065ba49230051474f977369d5a58e95 (patch)
treeb0bb0f41a5176eed0ea7937d73417b27e86ab363 /gpsmon.c
parent029b5e46b08810d0dcf65456edec877c1bda1105 (diff)
downloadgpsd-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.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gpsmon.c b/gpsmon.c
index f01d16f6..de29f005 100644
--- a/gpsmon.c
+++ b/gpsmon.c
@@ -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@*/