diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2013-11-06 11:36:14 -0500 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2013-11-06 11:36:14 -0500 |
commit | b85c3a67bcbfb65966f40a5e8d4bd66a2966fb6f (patch) | |
tree | 5a9a5c74e710c8e07152f4972e36951f1f587ea9 /ntpshm.c | |
parent | 8c5e661e42a753e08bae03d533bd4541f5d7d91b (diff) | |
download | gpsd-b85c3a67bcbfb65966f40a5e8d4bd66a2966fb6f.tar.gz |
Unify time-difference computations. All regression tests pass, PPS is live.
Diffstat (limited to 'ntpshm.c')
-rw-r--r-- | ntpshm.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -353,8 +353,7 @@ static void chrony_send(struct gps_device_t *session, struct timedrift_t *td) /*@-type@*//* splint is confused about struct timespec */ TSTOTV(&sample.tv, &td->real); /*@-compdef@*/ - sample.offset = td->real.tv_sec - td->clock.tv_sec; - sample.offset += (td->real.tv_nsec - td->clock.tv_nsec) / 1e9; + sample.offset = timespec_diff_ns(td->real, td->clock) / 1e9; /*@+compdef@*/ /*@+type@*/ |