summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 8573f6a)
raw | patch | inline | side by side (parent: 8573f6a)
author | Florian Forster <octo@collectd.org> | |
Sun, 19 Feb 2012 11:51:09 +0000 (12:51 +0100) | ||
committer | Florian Forster <octo@collectd.org> | |
Sun, 19 Feb 2012 11:51:09 +0000 (12:51 +0100) |
Change-Id: I9afcd8d17f1251b0765dfbdae5ed8581b73b15fe
src/amqp.c | patch | blob | history |
diff --git a/src/amqp.c b/src/amqp.c
index 55eba670bc712f195ee7b6117f8dc98d72db5d8a..be1f709e120181efdf7ce8181c4f9032f02047ed 100644 (file)
--- a/src/amqp.c
+++ b/src/amqp.c
status = camqp_connect (conf);
if (status != 0)
{
+ struct timespec ts_interval;
ERROR ("amqp plugin: camqp_connect failed. "
- "Will sleep for %u seconds.",
- (unsigned int) CDTIME_T_TO_TIME_T (interval_g));
- sleep ((unsigned int) CDTIME_T_TO_TIME_T (interval_g));
+ "Will sleep for %.3f seconds.",
+ CDTIME_T_TO_DOUBLE (interval_g));
+ CDTIME_T_TO_TIMESPEC (interval_g, &ts_interval);
+ nanosleep (&ts_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 %u seconds.",
- (unsigned int) CDTIME_T_TO_TIME_T (interval_g));
+ "Will sleep for %.3f seconds.",
+ CDTIME_T_TO_DOUBLE (interval_g));
camqp_close_connection (conf);
- sleep ((unsigned int) CDTIME_T_TO_TIME_T (interval_g));
+ CDTIME_T_TO_TIMESPEC (interval_g, &ts_interval);
+ nanosleep (&ts_interval, /* remaining = */ NULL);
continue;
}