Change in osmocom-bb[master]: layer23: Fix build against gpsd >= 3.20

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

pespin gerrit-no-reply at lists.osmocom.org
Wed Jan 15 14:07:40 UTC 2020


pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/16848 )

Change subject: layer23: Fix build against gpsd >= 3.20
......................................................................

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
---
M src/host/layer23/src/common/gps.c
1 file changed, 8 insertions(+), 0 deletions(-)

Approvals:
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved



diff --git a/src/host/layer23/src/common/gps.c b/src/host/layer23/src/common/gps.c
index 35ee416..807beed 100644
--- a/src/host/layer23/src/common/gps.c
+++ b/src/host/layer23/src/common/gps.c
@@ -82,7 +82,11 @@
 	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 @@
 	/* 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;

-- 
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/16848
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ie8ba19d030b6f46f2d8afc270a732ce8c26c438f
Gerrit-Change-Number: 16848
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin at sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <axilirator at gmail.com>
Gerrit-Reviewer: pespin <pespin at sysmocom.de>
Gerrit-MessageType: merged
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20200115/5c6d1bce/attachment.htm>


More information about the gerrit-log mailing list