gpsd-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gpsd-dev] [PATCH 3/4] Set time stamp in chrony SOCK sample correctly.


From: Miroslav Lichvar
Subject: [gpsd-dev] [PATCH 3/4] Set time stamp in chrony SOCK sample correctly.
Date: Fri, 22 Nov 2013 18:19:42 +0100

The tv field should be the local time when was the sample received, not
the reference time. Otherwise the sample could be ignored as coming from
future.
---
 ntpshm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/ntpshm.c b/ntpshm.c
index 109e4ea..fe8e450 100644
--- a/ntpshm.c
+++ b/ntpshm.c
@@ -351,7 +351,7 @@ static void chrony_send(struct gps_device_t *session, 
struct timedrift_t *td)
     sample.leap = session->context->leap_notify;
     sample.magic = SOCK_MAGIC;
     /address@hidden@*//* splint is confused about struct timespec */
-    TSTOTV(&sample.tv, &td->real);
+    TSTOTV(&sample.tv, &td->clock);
     /address@hidden@*/
     sample.offset = timespec_diff_ns(td->real, td->clock) / 1e9;
     /address@hidden@*/
-- 
1.8.3.1




reply via email to

[Prev in Thread] Current Thread [Next in Thread]