summaryrefslogtreecommitdiff
path: root/libgpsd_core.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2015-03-07 06:50:49 -0500
committerEric S. Raymond <esr@thyrsus.com>2015-03-07 06:50:49 -0500
commit2eed866084e4553473f63951d89de4490ce0169c (patch)
tree2871a2dda9955daabb8efab913cd3b13684cb8f8 /libgpsd_core.c
parent61c16bebe1a56cb1c211733b92474bf866eba87d (diff)
downloadgpsd-2eed866084e4553473f63951d89de4490ce0169c.tar.gz
Revert "ntplib extraction requires libgpsd object format bump to 23."
We need to sneak up on this in a more subtle way.
Diffstat (limited to 'libgpsd_core.c')
-rw-r--r--libgpsd_core.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c
index 26560cb6..d9db154a 100644
--- a/libgpsd_core.c
+++ b/libgpsd_core.c
@@ -303,8 +303,11 @@ void gpsd_init(struct gps_device_t *session, struct gps_context_t *context,
/* initialize GPS polling */
{
/* clear some times */
+ session->last_fixtime.real = 0.0;
+ /*@i2@*/session->last_fixtime.clock.tv_sec = 0;
+ /*@i2@*/session->last_fixtime.clock.tv_nsec = 0;
#ifdef PPS_ENABLE
- memset((void *)&session->pps_thread, 0, sizeof(session->pps_thread));
+ memset((void *)&session->pps_state, 0, sizeof(session->pps_state));
#endif /* PPS_ENABLE */
/*@ -mayaliasunique @*/
@@ -397,9 +400,12 @@ void gpsd_clear(struct gps_device_t *session)
/* clear the private data union */
memset( (void *)&session->driver, '\0', sizeof(session->driver));
-#ifdef PPS_ENABLE
/* clear some times */
- memset((void *)&session->pps_thread, 0, sizeof(session->pps_thread));
+ session->last_fixtime.real = 0.0;
+ /*@i2@*/session->last_fixtime.clock.tv_sec = 0;
+ /*@i2@*/session->last_fixtime.clock.tv_nsec = 0;
+#ifdef PPS_ENABLE
+ memset((void *)&session->pps_state, 0, sizeof(session->pps_state));
#endif /* PPS_ENABLE */
session->opentime = timestamp();
@@ -1641,7 +1647,7 @@ void ntp_latch(struct gps_device_t *device, struct timedelta_t /*@out@*/*td)
#ifdef PPS_ENABLE
/* thread-safe update */
/*@-compdef@*/
- status = pps_thread_stash_fixtime(&device->pps_thread,
+ status = pps_thread_stash_fixtime(&device->last_fixtime,
device->newdata.time, td->clock);
/*@+compdef@*/
if (status == PPS_LOCK_ERR) {