aboutsummaryrefslogtreecommitdiffstats
path: root/src/osmo-bts-oc2g
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-oc2g
parent9c75c387c04175298d7fae3dd432d84bd622fccd (diff)
{oc2g,sysmo}-mgr-calib: Fix build against gpsd >= 3.18
Diffstat (limited to 'src/osmo-bts-oc2g')
-rw-r--r--src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c b/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c
index 96162621..104d2792 100644
--- a/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c
+++ b/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c
@@ -69,6 +69,16 @@ enum calib_result {
CALIB_SUCCESS,
};
+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 int oc2gbts_par_get_uptime(void *ctx, int *ret)
{
char *fpath;
@@ -173,7 +183,7 @@ static int mgr_gps_read(struct osmo_fd *fd, unsigned int what)
int rc;
struct oc2gbts_mgr_instance *mgr = fd->data;
- rc = gps_read(&mgr->gps.gpsdata);
+ rc = compat_gps_read(&mgr->gps.gpsdata);
if (rc == -1) {
LOGP(DCALIB, LOGL_ERROR, "gpsd vanished during read.\n");
calib_state_reset(mgr, CALIB_FAIL_GPSFIX);