From 172405cbdbac33786316261d48652fe8558743c9 Mon Sep 17 00:00:00 2001 From: Miroslav Lichvar Date: Mon, 25 Nov 2013 13:23:02 +0100 Subject: [PATCH] set time stamp in chrony SOCK sample correctly --- gpsd-chronyts.patch | 25 +++++++++++++++++++++++++ gpsd.spec | 3 +++ 2 files changed, 28 insertions(+) create mode 100644 gpsd-chronyts.patch diff --git a/gpsd-chronyts.patch b/gpsd-chronyts.patch new file mode 100644 index 0000000..7631ddc --- /dev/null +++ b/gpsd-chronyts.patch @@ -0,0 +1,25 @@ +commit 14ad8ddef480df52e090bfea65b4ae081c241506 +Author: Miroslav Lichvar +Date: Fri Nov 22 18:19:42 2013 +0100 + + Set time stamp in chrony SOCK sample correctly. + + 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. + + Signed-off-by: Eric S. Raymond + +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; + /*@-type@*//* splint is confused about struct timespec */ +- TSTOTV(&sample.tv, &td->real); ++ TSTOTV(&sample.tv, &td->clock); + /*@-compdef@*/ + sample.offset = timespec_diff_ns(td->real, td->clock) / 1e9; + /*@+compdef@*/ diff --git a/gpsd.spec b/gpsd.spec index 8e411aa..ec941ea 100644 --- a/gpsd.spec +++ b/gpsd.spec @@ -15,6 +15,8 @@ Source11: gpsd.sysconfig Patch1: gpsd-nolibcap.patch # allow multiple options in LINKFLAGS Patch2: gpsd-linkflags.patch +# set time stamp in chrony SOCK sample correctly +Patch3: gpsd-chronyts.patch BuildRequires: dbus-devel dbus-glib-devel ncurses-devel xmlto python-devel BuildRequires: scons desktop-file-utils bluez-libs-devel pps-tools-devel @@ -79,6 +81,7 @@ can run on a serial terminal or terminal emulator. %setup -q %patch1 -p1 -b .nolibcap %patch2 -p1 -b .linkflags +%patch3 -p1 -b .chronyts %build export CCFLAGS="%{optflags}"