X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fgps.c;h=4d65176836b24946e135a2112d7cfea147236aa4;hb=a503c54a95d139f117650a0e6d80e6edfe81e8bf;hp=ecb4bbaa69d0c7e09e9d3a482512a1951d951ed5;hpb=22813e1a6a3d059efc67975893df985052661a7a;p=collectd.git diff --git a/src/gps.c b/src/gps.c index ecb4bbaa..4d651768 100644 --- a/src/gps.c +++ b/src/gps.c @@ -26,10 +26,10 @@ * Marc Fournier **/ -#include "common.h" +#include "collectd.h" #include "plugin.h" +#include "utils/common/common.h" #include "utils_time.h" -#include "collectd.h" #define CGPS_TRUE 1 #define CGPS_FALSE 0 @@ -80,7 +80,7 @@ static int cgps_thread_pause(cdtime_t pTime) { int ret = !cgps_thread_shutdown; - pthread_mutex_lock(&cgps_thread_lock); + pthread_mutex_unlock(&cgps_thread_lock); return ret; } @@ -141,7 +141,12 @@ static void *cgps_thread(void *pData) { continue; } - if (gps_read(&gpsd_conn) == -1) { +#if GPSD_API_MAJOR_VERSION > 6 + if (gps_read(&gpsd_conn, NULL, 0) == -1) +#else + if (gps_read(&gpsd_conn) == -1) +#endif + { WARNING("gps plugin: incorrect data! (err_count: %d)", err_count); err_count++;