diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2015-02-12 12:05:26 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2015-02-12 12:05:26 -0500 |
commit | 036d54fcffacac2ae32ce8d6970b1eba8f85269b (patch) | |
tree | 883545160bbe50cc31fd61d62e359026da5289fd /libgpsd_core.c | |
parent | 8b107ca209a3ebc40bef62679d17f0b58760bb7e (diff) | |
download | gpsd-036d54fcffacac2ae32ce8d6970b1eba8f85269b.tar.gz |
Mutex-lock the update of last-fix time.
Diffstat (limited to 'libgpsd_core.c')
-rw-r--r-- | libgpsd_core.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libgpsd_core.c b/libgpsd_core.c index a7c5664d..e61ed3ae 100644 --- a/libgpsd_core.c +++ b/libgpsd_core.c @@ -1677,9 +1677,9 @@ void ntpshm_latch(struct gps_device_t *device, struct timedrift_t /*@out@*/*td) td->real.tv_sec = (time_t)integral; td->real.tv_nsec = (long)(fractional * 1e+9); /*@+type@*/ - device->last_fixtime.real = device->newdata.time; - /* structure copy */ - device->last_fixtime.clock = td->clock; + + /* thread-safe update */ + pps_stash_fixtime(device, device->newdata.time, td->clock); } #endif /* NTPSHM_ENABLE */ |