diff options
author | Gary E. Miller <gem@rellim.com> | 2015-02-02 18:45:51 -0800 |
---|---|---|
committer | Gary E. Miller <gem@rellim.com> | 2015-02-02 18:45:51 -0800 |
commit | ecd2cb4be10f15f894f17abb9ac22ca95ef397a0 (patch) | |
tree | e2ccff55b4dd6f081b2675de0fc900f2a4c86d4c /libgpsd_core.c | |
parent | 5cdb72bba8476b3cfcdaee63fa9b94ddc484811d (diff) | |
download | gpsd-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.c | 4 |
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 |