X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Famqp.c;h=423b251c33619b378c463afaec24de21e623dfef;hp=73bc1a2961e22d43dcf4b60299ba86b254588517;hb=7b8851b26928b609ce850e78c1eabb50ff319244;hpb=be126043c2be20399d7670fe194645292018bde0 diff --git a/src/amqp.c b/src/amqp.c index 73bc1a29..423b251c 100644 --- a/src/amqp.c +++ b/src/amqp.c @@ -218,17 +218,17 @@ static char *camqp_strerror(camqp_config_t *conf, /* {{{ */ amqp_connection_close_t *m = r.reply.decoded; char *tmp = camqp_bytes_cstring(&m->reply_text); snprintf(buffer, buffer_size, "Server connection error %d: %s", - m->reply_code, tmp); + m->reply_code, tmp); sfree(tmp); } else if (r.reply.id == AMQP_CHANNEL_CLOSE_METHOD) { amqp_channel_close_t *m = r.reply.decoded; char *tmp = camqp_bytes_cstring(&m->reply_text); snprintf(buffer, buffer_size, "Server channel error %d: %s", - m->reply_code, tmp); + m->reply_code, tmp); sfree(tmp); } else { snprintf(buffer, buffer_size, "Server error method %#" PRIx32, - r.reply.id); + r.reply.id); } break; @@ -507,7 +507,7 @@ static int camqp_connect(camqp_config_t *conf) /* {{{ */ static int camqp_shutdown(void) /* {{{ */ { - DEBUG("amqp plugin: Shutting down %zu subscriber threads.", + DEBUG("amqp plugin: Shutting down %" PRIsz " subscriber threads.", subscriber_threads_num); subscriber_threads_running = 0; @@ -759,8 +759,8 @@ static int camqp_write(const data_set_t *ds, const value_list_t *vl, /* {{{ */ sstrncpy(routing_key, conf->routing_key, sizeof(routing_key)); } else { snprintf(routing_key, sizeof(routing_key), "collectd/%s/%s/%s/%s/%s", - vl->host, vl->plugin, vl->plugin_instance, vl->type, - vl->type_instance); + vl->host, vl->plugin, vl->plugin_instance, vl->type, + vl->type_instance); /* Switch slashes (the only character forbidden by collectd) and dots * (the separation character used by AMQP). */ @@ -982,10 +982,11 @@ static int camqp_config_connection(oconfig_item_t *ci, /* {{{ */ char cbname[128]; snprintf(cbname, sizeof(cbname), "amqp/%s", conf->name); - status = plugin_register_write( - cbname, camqp_write, &(user_data_t){ - .data = conf, .free_func = camqp_config_free, - }); + status = + plugin_register_write(cbname, camqp_write, + &(user_data_t){ + .data = conf, .free_func = camqp_config_free, + }); if (status != 0) { camqp_config_free(conf); return status;