summaryrefslogtreecommitdiff
path: root/libgpsd_core.c
diff options
context:
space:
mode:
authorGary E. Miller <gem@rellim.com>2015-02-02 18:45:51 -0800
committerGary E. Miller <gem@rellim.com>2015-02-02 18:45:51 -0800
commitecd2cb4be10f15f894f17abb9ac22ca95ef397a0 (patch)
treee2ccff55b4dd6f081b2675de0fc900f2a4c86d4c /libgpsd_core.c
parent5cdb72bba8476b3cfcdaee63fa9b94ddc484811d (diff)
downloadgpsd-ecd2cb4be10f15f894f17abb9ac22ca95ef397a0.tar.gz
Mask a NAN in ntpshm_latch(). Cause of NAN in ppsthread.c
The root cause still to be found.
Diffstat (limited to 'libgpsd_core.c')
-rw-r--r--libgpsd_core.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c
index 1d5eeffa..a6560001 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -1679,6 +1679,10 @@ void ntpshm_latch(struct gps_device_t *device, struct timedrift_t /*@out@*/*td)
(void)gettimeofday(&clock_tv, NULL);
TVTOTS(&td->clock, &clock_tv);
#endif /* HAVE_CLOCK_GETTIME */
+ if ( isnan( device->newdata.time ) ) {
+ /* this should not happen, but it does */
+ device->newdata.time = 0.0;
+ }
fix_time = device->newdata.time;
/* assume zero when there's no offset method */
if (device->device_type == NULL