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

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Tue Nov 6 21:48:04 UTC 2018


Harald Welte has submitted this change and it was merged. ( https://gerrit.osmocom.org/11609 )

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

layer23: Fix build against gpsd >= 3.18

Change-Id: I0e97d3e8c3688064c959ea60ecef50cfbbc1bcd6
---
M src/host/layer23/src/common/gps.c
1 file changed, 13 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  Vadim Yanitskiy: Looks good to me, but someone else must approve
  Harald Welte: Looks good to me, approved



diff --git a/src/host/layer23/src/common/gps.c b/src/host/layer23/src/common/gps.c
index 3ec7377..35ee416 100644
--- a/src/host/layer23/src/common/gps.c
+++ b/src/host/layer23/src/common/gps.c
@@ -60,9 +60,20 @@
 
 #if GPSD_API_MAJOR_VERSION >= 5
 static struct gps_data_t _gdata;
-#define gps_poll gps_read
 #endif
 
+static inline int compat_gps_read(struct gps_data_t *data)
+{
+/* API break in gpsd 6bba8b329fc7687b15863d30471d5af402467802 */
+#if GPSD_API_MAJOR_VERSION >= 7 && GPSD_API_MINOR_VERSION >= 0
+	return gps_read(data, NULL, 0);
+#elif GPSD_API_MAJOR_VERSION >= 5
+	return gps_read(data);
+#else
+	return gps_poll(data);
+#endif
+}
+
 int osmo_gpsd_cb(struct osmo_fd *bfd, unsigned int what)
 {
 	struct tm *tm;
@@ -85,7 +96,7 @@
 #endif
 
 	/* polling returned an error */
-	if (gps_poll(gdata))
+	if (compat_gps_read(gdata))
 	    goto gps_not_ready;
 
 	/* data are valid */

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I0e97d3e8c3688064c959ea60ecef50cfbbc1bcd6
Gerrit-Change-Number: 11609
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol <pespin at sysmocom.de>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Jenkins Builder (1000002)
Gerrit-Reviewer: Vadim Yanitskiy <axilirator at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20181106/020fa7ce/attachment.htm>


More information about the gerrit-log mailing list