projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
virt plugin: Added support for new shutdown event details
[collectd.git]
/
src
/
gps.c
diff --git
a/src/gps.c
b/src/gps.c
index
686710b
..
4d65176
100644
(file)
--- a/
src/gps.c
+++ b/
src/gps.c
@@
-27,8
+27,8
@@
**/
#include "collectd.h"
**/
#include "collectd.h"
-#include "common.h"
#include "plugin.h"
#include "plugin.h"
+#include "utils/common/common.h"
#include "utils_time.h"
#define CGPS_TRUE 1
#include "utils_time.h"
#define CGPS_TRUE 1
@@
-141,7
+141,12
@@
static void *cgps_thread(void *pData) {
continue;
}
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++;
WARNING("gps plugin: incorrect data! (err_count: %d)", err_count);
err_count++;
@@
-226,7
+231,7
@@
static int cgps_read(void) {
cgps_submit("satellites", data_copy.sats_used, "used");
cgps_submit("satellites", data_copy.sats_visible, "visible");
cgps_submit("satellites", data_copy.sats_used, "used");
cgps_submit("satellites", data_copy.sats_visible, "visible");
- return
(0)
;
+ return
0
;
}
/**
}
/**
@@
-262,7
+267,7
@@
static int cgps_config(oconfig_item_t *ci) {
cgps_config_data.timeout = CGPS_DEFAULT_TIMEOUT;
}
cgps_config_data.timeout = CGPS_DEFAULT_TIMEOUT;
}
- return
(0)
;
+ return
0
;
}
/**
}
/**
@@
-286,10
+291,10
@@
static int cgps_init(void) {
plugin_thread_create(&cgps_thread_id, NULL, cgps_thread, NULL, "gps");
if (status != 0) {
ERROR("gps plugin: pthread_create() failed.");
plugin_thread_create(&cgps_thread_id, NULL, cgps_thread, NULL, "gps");
if (status != 0) {
ERROR("gps plugin: pthread_create() failed.");
- return
(-1)
;
+ return
-1
;
}
}
- return
(0)
;
+ return
0
;
}
/**
}
/**
@@
-314,7
+319,7
@@
static int cgps_shutdown(void) {
sfree(cgps_config_data.port);
sfree(cgps_config_data.host);
sfree(cgps_config_data.port);
sfree(cgps_config_data.host);
- return
(0)
;
+ return
0
;
}
/**
}
/**