summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Curley <charlescurley@charlescurley.com>2019-02-18 15:17:19 -0700
committerCharles Curley <charlescurley@charlescurley.com>2019-02-18 15:17:19 -0700
commit2f2c220615c7145177c11d9a192b4773f208d169 (patch)
treec628c47e138b816f194338c0f641d05b2071ff09
parent01c076277d5483abebc96ff0026a160c8b2390fc (diff)
downloadnavit-curleyGPSD3.18.tar.gz
patch:vehicle:gpsd allow navit to use gpsd API version 7 and higher, which have an API change.curleyGPSD3.18
modified: navit/vehicle/gpsd/vehicle_gpsd.c
-rw-r--r--navit/vehicle/gpsd/vehicle_gpsd.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/navit/vehicle/gpsd/vehicle_gpsd.c b/navit/vehicle/gpsd/vehicle_gpsd.c
index 95324f324..99a4b4ffc 100644
--- a/navit/vehicle/gpsd/vehicle_gpsd.c
+++ b/navit/vehicle/gpsd/vehicle_gpsd.c
@@ -325,7 +325,11 @@ static void vehicle_gpsd_io(struct vehicle_priv *priv) {
int read_result;
/* Read until EOF, in case we are lagging behind.
* No point in processing old GPS reports. */
+#if GPSD_API_MAJOR_VERSION >= 7
+ while((read_result=gps_read(priv->gps, NULL, 0))>0);
+#else
while((read_result=gps_read(priv->gps))>0);
+#endif
if(read_result==-1) {
dbg(lvl_error,"gps_poll failed");
vehicle_gpsd_close(priv);