X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=src%2Famqp.c;h=882df7c576d0bc513afa54c87c18d58278b880c1;hb=a9f509bacfda6be6882527a16563f260e4373246;hp=06fd1f1d4aecd3d11ed9502fbea45baecc527e00;hpb=f2f7049e8faff8043b12d7c7548d9398d3b3ada4;p=collectd.git diff --git a/src/amqp.c b/src/amqp.c index 06fd1f1d..882df7c5 100644 --- a/src/amqp.c +++ b/src/amqp.c @@ -599,9 +599,9 @@ static int camqp_read_body (camqp_config_t *conf, /* {{{ */ if (strcasecmp ("text/collectd", content_type) == 0) { - status = handle_putval (stderr, body); + status = cmd_handle_putval (stderr, body); if (status != 0) - ERROR ("amqp plugin: handle_putval failed with status %i.", + ERROR ("amqp plugin: cmd_handle_putval failed with status %i.", status); return (status); } @@ -677,25 +677,21 @@ static void *camqp_subscribe_thread (void *user_data) /* {{{ */ status = camqp_connect (conf); if (status != 0) { - struct timespec ts_interval; ERROR ("amqp plugin: camqp_connect failed. " "Will sleep for %.3f seconds.", CDTIME_T_TO_DOUBLE (interval)); - CDTIME_T_TO_TIMESPEC (interval, &ts_interval); - nanosleep (&ts_interval, /* remaining = */ NULL); + nanosleep (&CDTIME_T_TO_TIMESPEC (interval), /* remaining = */ NULL); continue; } status = amqp_simple_wait_frame (conf->connection, &frame); if (status < 0) { - struct timespec ts_interval; ERROR ("amqp plugin: amqp_simple_wait_frame failed. " "Will sleep for %.3f seconds.", CDTIME_T_TO_DOUBLE (interval)); camqp_close_connection (conf); - CDTIME_T_TO_TIMESPEC (interval, &ts_interval); - nanosleep (&ts_interval, /* remaining = */ NULL); + nanosleep (&CDTIME_T_TO_TIMESPEC (interval), /* remaining = */ NULL); continue; } @@ -838,10 +834,10 @@ static int camqp_write (const data_set_t *ds, const value_list_t *vl, /* {{{ */ if (conf->format == CAMQP_FORMAT_COMMAND) { - status = create_putval (buffer, sizeof (buffer), ds, vl); + status = cmd_create_putval (buffer, sizeof (buffer), ds, vl); if (status != 0) { - ERROR ("amqp plugin: create_putval failed with status %i.", + ERROR ("amqp plugin: cmd_create_putval failed with status %i.", status); return (status); }