projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add snprintf wrapper for GCC 8.2/3
[collectd.git]
/
src
/
ping.c
diff --git
a/src/ping.c
b/src/ping.c
index
89e407b
..
203d223
100644
(file)
--- a/
src/ping.c
+++ b/
src/ping.c
@@
-26,8
+26,8
@@
#include "collectd.h"
#include "collectd.h"
-#include "common.h"
#include "plugin.h"
#include "plugin.h"
+#include "utils/common/common.h"
#include "utils_complain.h"
#include <netinet/in.h>
#include "utils_complain.h"
#include <netinet/in.h>
@@
-69,14
+69,14
@@
typedef struct hostlist_s hostlist_t;
/*
* Private variables
*/
/*
* Private variables
*/
-static hostlist_t *hostlist_head
= NULL
;
+static hostlist_t *hostlist_head;
static int ping_af = PING_DEF_AF;
static int ping_af = PING_DEF_AF;
-static char *ping_source
= NULL
;
+static char *ping_source;
#ifdef HAVE_OPING_1_3
#ifdef HAVE_OPING_1_3
-static char *ping_device
= NULL
;
+static char *ping_device;
#endif
#endif
-static char *ping_data
= NULL
;
+static char *ping_data;
static int ping_ttl = PING_DEF_TTL;
static double ping_interval = 1.0;
static double ping_timeout = 0.9;
static int ping_ttl = PING_DEF_TTL;
static double ping_interval = 1.0;
static double ping_timeout = 0.9;
@@
-84,8
+84,8
@@
static int ping_max_missed = -1;
static pthread_mutex_t ping_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t ping_cond = PTHREAD_COND_INITIALIZER;
static pthread_mutex_t ping_lock = PTHREAD_MUTEX_INITIALIZER;
static pthread_cond_t ping_cond = PTHREAD_COND_INITIALIZER;
-static int ping_thread_loop
= 0
;
-static int ping_thread_error
= 0
;
+static int ping_thread_loop;
+static int ping_thread_error;
static pthread_t ping_thread_id;
static const char *config_keys[] = {"Host", "SourceAddress", "AddressFamily",
static pthread_t ping_thread_id;
static const char *config_keys[] = {"Host", "SourceAddress", "AddressFamily",
@@
-298,7
+298,7
@@
static void *ping_thread(void *arg) /* {{{ */
pthread_mutex_lock(&ping_lock);
while (ping_thread_loop > 0) {
pthread_mutex_lock(&ping_lock);
while (ping_thread_loop > 0) {
- bool send_successful =
0
;
+ bool send_successful =
false
;
if (gettimeofday(&tv_begin, NULL) < 0) {
ERROR("ping plugin: gettimeofday failed: %s", STRERRNO);
if (gettimeofday(&tv_begin, NULL) < 0) {
ERROR("ping plugin: gettimeofday failed: %s", STRERRNO);
@@
-314,7
+314,7
@@
static void *ping_thread(void *arg) /* {{{ */
ping_get_error(pingobj));
} else {
c_release(LOG_NOTICE, &complaint, "ping plugin: ping_send succeeded.");
ping_get_error(pingobj));
} else {
c_release(LOG_NOTICE, &complaint, "ping plugin: ping_send succeeded.");
- send_successful =
1
;
+ send_successful =
true
;
}
pthread_mutex_lock(&ping_lock);
}
pthread_mutex_lock(&ping_lock);