projects
/
collectd.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
collectd-tg: fix warning
[collectd.git]
/
src
/
write_sensu.c
diff --git
a/src/write_sensu.c
b/src/write_sensu.c
index
71dd585
..
3b4a574
100644
(file)
--- a/
src/write_sensu.c
+++ b/
src/write_sensu.c
@@
-107,10
+107,10
@@
struct sensu_host {
#define F_READY 0x01
uint8_t flags;
pthread_mutex_t lock;
#define F_READY 0x01
uint8_t flags;
pthread_mutex_t lock;
-
_B
ool notifications;
-
_B
ool metrics;
-
_B
ool store_rates;
-
_B
ool always_append_ds;
+
b
ool notifications;
+
b
ool metrics;
+
b
ool store_rates;
+
b
ool always_append_ds;
char *separator;
char *node;
char *service;
char *separator;
char *node;
char *service;
@@
-119,8
+119,8
@@
struct sensu_host {
int reference_count;
};
int reference_count;
};
-static char *sensu_tags
= NULL
;
-static char **sensu_attrs
= NULL
;
+static char *sensu_tags;
+static char **sensu_attrs;
static size_t sensu_attrs_num;
static int add_str_to_list(struct str_list *strs,
static size_t sensu_attrs_num;
static int add_str_to_list(struct str_list *strs,
@@
-627,7
+627,7
@@
static char *replace_str(const char *str, const char *old, /* {{{ */
r += newlen;
p = q + oldlen;
}
r += newlen;
p = q + oldlen;
}
- s
trncpy(r, p, strlen(p
));
+ s
strncpy(r, p, sizeof(r
));
return ret;
} /* }}} char *replace_str */
return ret;
} /* }}} char *replace_str */
@@
-1019,10
+1019,10
@@
static int sensu_config_node(oconfig_item_t *ci) /* {{{ */
host->reference_count = 1;
host->node = NULL;
host->service = NULL;
host->reference_count = 1;
host->node = NULL;
host->service = NULL;
- host->notifications =
0
;
- host->metrics =
0
;
- host->store_rates =
1
;
- host->always_append_ds =
0
;
+ host->notifications =
false
;
+ host->metrics =
false
;
+ host->store_rates =
true
;
+ host->always_append_ds =
false
;
host->metric_handlers.nb_strs = 0;
host->metric_handlers.strs = NULL;
host->notification_handlers.nb_strs = 0;
host->metric_handlers.nb_strs = 0;
host->metric_handlers.strs = NULL;
host->notification_handlers.nb_strs = 0;
@@
-1124,16
+1124,17
@@
static int sensu_config_node(oconfig_item_t *ci) /* {{{ */
return -1;
}
return -1;
}
- if ((host->notification_handlers.nb_strs > 0) && (host->notifications == 0)) {
+ if ((host->notification_handlers.nb_strs > 0) &&
+ (host->notifications == false)) {
WARNING("write_sensu plugin: NotificationHandler given so forcing "
"notifications to be enabled");
host->notifications = 1;
}
WARNING("write_sensu plugin: NotificationHandler given so forcing "
"notifications to be enabled");
host->notifications = 1;
}
- if ((host->metric_handlers.nb_strs > 0) && (host->metrics ==
0
)) {
+ if ((host->metric_handlers.nb_strs > 0) && (host->metrics ==
false
)) {
WARNING("write_sensu plugin: MetricHandler given so forcing metrics to be "
"enabled");
WARNING("write_sensu plugin: MetricHandler given so forcing metrics to be "
"enabled");
- host->metrics =
1
;
+ host->metrics =
true
;
}
if (!(host->notifications || host->metrics)) {
}
if (!(host->notifications || host->metrics)) {