Merge remote-tracking branch 'github/pr/2040'
[collectd.git] / src / amqp.c
index f9777a9..4089fc3 100644 (file)
@@ -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;
         }
 
@@ -741,7 +737,7 @@ static int camqp_subscribe_init (camqp_config_t *conf) /* {{{ */
     memset (tmp, 0, sizeof (*tmp));
 
     status = plugin_thread_create (tmp, /* attr = */ NULL,
-            camqp_subscribe_thread, conf);
+            camqp_subscribe_thread, conf, "amqp subscribe");
     if (status != 0)
     {
         char errbuf[1024];