X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Fwrite_graphite.c;h=b39448ffad3c2069aeef50f86131f4ac3a4ad978;hb=34119a09da2caa377c6b7111b1e3e0ab01058a69;hp=1aa07f1063ecf354c866c6004efa3c3ec16840b9;hpb=1804ab004b8c7e14eac8c3a662747fbae4cf4aad;p=collectd.git diff --git a/src/write_graphite.c b/src/write_graphite.c index 1aa07f10..b39448ff 100644 --- a/src/write_graphite.c +++ b/src/write_graphite.c @@ -175,7 +175,7 @@ static int wg_flush_nolock(cdtime_t timeout, struct wg_callback *cb) { int status; DEBUG("write_graphite plugin: wg_flush_nolock: timeout = %.3f; " - "send_buf_fill = %zu;", + "send_buf_fill = %" PRIsz ";", (double)timeout, cb->send_buf_fill); /* timeout == 0 => flush unconditionally */ @@ -303,6 +303,7 @@ static void wg_callback_free(void *data) { sfree(cb->prefix); sfree(cb->postfix); + pthread_mutex_unlock(&cb->send_lock); pthread_mutex_destroy(&cb->send_lock); sfree(cb); @@ -372,7 +373,8 @@ static int wg_send_message(char const *message, struct wg_callback *cb) { cb->send_buf_fill += message_len; cb->send_buf_free -= message_len; - DEBUG("write_graphite plugin: [%s]:%s (%s) buf %zu/%zu (%.1f %%) \"%s\"", + DEBUG("write_graphite plugin: [%s]:%s (%s) buf %" PRIsz "/%" PRIsz + " (%.1f %%) \"%s\"", cb->node, cb->service, cb->protocol, cb->send_buf_fill, sizeof(cb->send_buf), 100.0 * ((double)cb->send_buf_fill) / ((double)sizeof(cb->send_buf)),