aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-sysmo
diff options
context:
space:
mode:
authorPau Espin Pedrol <pespin@sysmocom.de>2018-10-29 18:17:04 +0100
committerPau Espin Pedrol <pespin@sysmocom.de>2018-10-29 18:17:04 +0100
commit2910b783051aa5059aeb370b164a1ee82ac3095c (patch)
tree03405c2b807f8f3b2379ed1e9693650b09cf98d7 /src/osmo-bts-sysmo
parent9c75c387c04175298d7fae3dd432d84bd622fccd (diff)
{oc2g,sysmo}-mgr-calib: Fix build against gpsd >= 3.18
Diffstat (limited to 'src/osmo-bts-sysmo')
-rw-r--r--src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c b/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c
index 62509f2a..b0b5edd8 100644
--- a/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c
+++ b/src/osmo-bts-sysmo/misc/sysmobts_mgr_calib.c
@@ -57,6 +57,16 @@ enum calib_result {
CALIB_SUCESS,
};
+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);
+#else
+ return gps_read(data);
+#endif
+}
+
static void calib_loop_run(void *_data)
{
int rc;
@@ -109,8 +119,7 @@ static int mgr_gps_read(struct osmo_fd *fd, unsigned int what)
{
int rc;
struct sysmobts_mgr_instance *mgr = fd->data;
-
- rc = gps_read(&mgr->calib.gpsdata);
+ rc = compat_gps_read(&mgr->calib.gpsdata);
if (rc == -1) {
LOGP(DCALIB, LOGL_ERROR, "gpsd vanished during read.\n");
calib_state_reset(mgr, CALIB_FAIL_GPS);