From: Florian Forster Date: Sun, 19 Feb 2012 11:42:57 +0000 (+0100) Subject: AMQP plugin: Fix sleeping of "interval_g seconds". X-Git-Tag: collectd-5.0.4~6 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=8573f6aa5dfcea9e104f23b3316f55e33976ccee;p=collectd.git AMQP plugin: Fix sleeping of "interval_g seconds". Since "interval_g" was changed to "cdtime_t", the plugin would sleep 2^30 times as long as intended. D'oh! Thanks to Xavier for reporting this! Change-Id: I8e9992307a1fdbb2df799a5359eb6695409684df --- diff --git a/src/amqp.c b/src/amqp.c index f0abd44b..55eba670 100644 --- a/src/amqp.c +++ b/src/amqp.c @@ -551,8 +551,9 @@ static void *camqp_subscribe_thread (void *user_data) /* {{{ */ if (status != 0) { ERROR ("amqp plugin: camqp_connect failed. " - "Will sleep for %i seconds.", interval_g); - sleep (interval_g); + "Will sleep for %u seconds.", + (unsigned int) CDTIME_T_TO_TIME_T (interval_g)); + sleep ((unsigned int) CDTIME_T_TO_TIME_T (interval_g)); continue; } @@ -560,9 +561,10 @@ 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 %u seconds.", + (unsigned int) CDTIME_T_TO_TIME_T (interval_g)); camqp_close_connection (conf); - sleep (interval_g); + sleep ((unsigned int) CDTIME_T_TO_TIME_T (interval_g)); continue; }