X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Famqp.c;h=adf4792b534b85f3219b6d5423bcc3c7c18a140a;hb=45aa67ef031ed2b8083f92efa2cbb76e0da8c02e;hp=c77c345bbcd071b1a5fc9a8c150e8d5957b47cfc;hpb=c93443fba5ae325325db311850ff0d6d9f7135e3;p=collectd.git diff --git a/src/amqp.c b/src/amqp.c index c77c345b..adf4792b 100644 --- a/src/amqp.c +++ b/src/amqp.c @@ -26,18 +26,14 @@ * Florian Forster **/ -#include -#include -#include -#include -#include - #include "collectd.h" #include "common.h" #include "plugin.h" #include "utils_cmd_putval.h" #include "utils_format_json.h" +#include + #include #include @@ -403,7 +399,7 @@ static int camqp_connect (camqp_config_t *conf) /* {{{ */ return (0); } /* }}} int camqp_connect */ -static int shutdown (void) /* {{{ */ +static int camqp_shutdown (void) /* {{{ */ { size_t i; @@ -426,7 +422,7 @@ static int shutdown (void) /* {{{ */ DEBUG ("amqp plugin: All subscriber threads exited."); return (0); -} /* }}} int shutdown */ +} /* }}} int camqp_shutdown */ /* * Subscribing code @@ -555,7 +551,8 @@ static void *camqp_subscribe_thread (void *user_data) /* {{{ */ if (status != 0) { ERROR ("amqp plugin: camqp_connect failed. " - "Will sleep for %i seconds.", interval_g); + "Will sleep for %.3f seconds.", + CDTIME_T_TO_DOUBLE (interval_g)); sleep (interval_g); continue; } @@ -564,7 +561,8 @@ static void *camqp_subscribe_thread (void *user_data) /* {{{ */ if (status < 0) { ERROR ("amqp plugin: amqp_simple_wait_frame failed. " - "Will sleep for %i seconds.", interval_g); + "Will sleep for %.3f seconds.", + CDTIME_T_TO_DOUBLE (interval_g)); camqp_close_connection (conf); sleep (interval_g); continue; @@ -629,6 +627,7 @@ static int camqp_subscribe_init (camqp_config_t *conf) /* {{{ */ /* * Publishing code */ +/* XXX: You must hold "conf->lock" when calling this function! */ static int camqp_write_locked (camqp_config_t *conf, /* {{{ */ const char *buffer, const char *routing_key) { @@ -936,7 +935,7 @@ static int camqp_config (oconfig_item_t *ci) /* {{{ */ void module_register (void) { plugin_register_complex_config ("amqp", camqp_config); - plugin_register_shutdown ("amqp", shutdown); + plugin_register_shutdown ("amqp", camqp_shutdown); } /* void module_register */ /* vim: set sw=4 sts=4 et fdm=marker : */