File 0001-layer23-Fix-build-against-gpsd-3.20.patch of Package osmocom-bb-fixeria-trx
From 5738e579b29b00b5f23c4762d15912a4cd391fd9 Mon Sep 17 00:00:00 2001
From: Pau Espin Pedrol <pespin@sysmocom.de>
Date: Mon, 13 Jan 2020 17:28:18 +0100
Subject: [PATCH] layer23: Fix build against gpsd >= 3.20
During 3.19->3.20 dev cycle, some fields were transformed from
timestamp_t or double to timespec_t. See for instance gpsd.git
f7c230fceb6d64483757f8c32afb98e6a2cb9413.
Change-Id: Ie8ba19d030b6f46f2d8afc270a732ce8c26c438f
---
src/host/layer23/src/common/gps.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/src/host/layer23/src/common/gps.c b/src/host/layer23/src/common/gps.c
index 35ee4167..807beed4 100644
--- a/src/host/layer23/src/common/gps.c
+++ b/src/host/layer23/src/common/gps.c
@@ -82,7 +82,11 @@ int osmo_gpsd_cb(struct osmo_fd *bfd, unsigned int what)
g.valid = 0;
/* gps is offline */
+#if GPSD_API_MAJOR_VERSION >= 9 && GPSD_API_MINOR_VERSION >= 0
+ if (gdata->online.tv_sec || gdata->online.tv_nsec)
+#else
if (gdata->online)
+#endif
goto gps_not_ready;
#if GPSD_API_MAJOR_VERSION >= 5
@@ -102,7 +106,11 @@ int osmo_gpsd_cb(struct osmo_fd *bfd, unsigned int what)
/* data are valid */
if (gdata->set & LATLON_SET) {
g.valid = 1;
+#if GPSD_API_MAJOR_VERSION >= 9 && GPSD_API_MINOR_VERSION >= 0
+ g.gmt = gdata->fix.time.tv_sec;
+#else
g.gmt = gdata->fix.time;
+#endif
tm = localtime(&g.gmt);
diff = time(NULL) - g.gmt;
g.latitude = gdata->fix.latitude;
--
2.26.2