summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 4ac3040)
raw | patch | inline | side by side (parent: 4ac3040)
author | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 4 Mar 2016 12:10:56 +0000 (13:10 +0100) | ||
committer | Ruben Kerkhof <ruben@rubenkerkhof.com> | |
Fri, 4 Mar 2016 12:10:56 +0000 (13:10 +0100) |
src/daemon/plugin.c | patch | blob | history | |
src/daemon/utils_time.c | patch | blob | history | |
src/mqtt.c | patch | blob | history |
diff --git a/src/daemon/plugin.c b/src/daemon/plugin.c
index be73774a58e42c8abbd22ce86b72fe1b442bdb85..788b4549f8ad4380aeab8be6eb3d2535c9c65141 100644 (file)
--- a/src/daemon/plugin.c
+++ b/src/daemon/plugin.c
if (ctx.flush_interval != 0)
{
char *flush_name;
- user_data_t ud;
flush_callback_t *cb;
flush_name = plugin_flush_callback_name (name);
}
cb->timeout = ctx.flush_timeout;
- ud.data = cb;
- ud.free_func = plugin_flush_timeout_callback_free;
+ ud->data = cb;
+ ud->free_func = plugin_flush_timeout_callback_free;
status = plugin_register_complex_read (
/* group = */ "flush",
/* name = */ flush_name,
/* callback = */ plugin_flush_timeout_callback,
/* interval = */ ctx.flush_interval,
- /* user data = */ &ud);
+ /* user data = */ ud);
sfree (flush_name);
if (status != 0)
index 47ed6d393ba489fdf1bd9399a4c321de11b87f84..56c250cdbb6479b2a1f07297dc2e5f9800243675 100644 (file)
--- a/src/daemon/utils_time.c
+++ b/src/daemon/utils_time.c
@@ -127,7 +127,7 @@ static int format_rfc3339 (char *buffer, size_t buffer_size, cdtime_t t, _Bool p
if (localtime_r (&t_spec.tv_sec, &t_tm) == NULL) {
char errbuf[1024];
- int status = errno;
+ status = errno;
ERROR ("format_rfc3339: localtime_r failed: %s",
sstrerror (status, errbuf, sizeof (errbuf)));
return (status);
diff --git a/src/mqtt.c b/src/mqtt.c
index 8bc412c9497213074a738ca7dfa355209c1872d1..4977f6841e72454c46ecbb35f5c995254dd48e3f 100644 (file)
--- a/src/mqtt.c
+++ b/src/mqtt.c
cf_util_get_string (child, &conf->host);
else if (strcasecmp ("Port", child->key) == 0)
{
- int tmp = cf_util_get_port_number (child);
- if (tmp < 0)
+ status = cf_util_get_port_number (child);
+ if (status < 0)
ERROR ("mqtt plugin: Invalid port number.");
else
- conf->port = tmp;
+ conf->port = status;
}
else if (strcasecmp ("ClientId", child->key) == 0)
cf_util_get_string (child, &conf->client_id);
cf_util_get_string (child, &conf->password);
else if (strcasecmp ("QoS", child->key) == 0)
{
- int tmp = -1;
- status = cf_util_get_int (child, &tmp);
- if ((status != 0) || (tmp < 0) || (tmp > 2))
+ int qos = -1;
+ status = cf_util_get_int (child, &qos);
+ if ((status != 0) || (qos < 0) || (qos > 2))
ERROR ("mqtt plugin: Not a valid QoS setting.");
else
- conf->qos = tmp;
+ conf->qos = qos;
}
else if (strcasecmp ("Topic", child->key) == 0)
cf_util_get_string (child, &conf->topic);