diff --git a/src/collectd.c b/src/collectd.c
index 98b9a1623f77b8840e6dbf36dbd7cfa4c69b2f1e..a1e15bf1e7ca52b674632b1308012c91297d2c00 100644 (file)
--- a/src/collectd.c
+++ b/src/collectd.c
curtime = time (NULL);
/* Issue all plugins */
curtime = time (NULL);
/* Issue all plugins */
- plugin_read_all ();
+ plugin_read_all (&loop);
if (gettimeofday (&tv_now, NULL) < 0)
{
if (gettimeofday (&tv_now, NULL) < 0)
{
continue;
}
continue;
}
- while (nanosleep (&ts_wait, &ts_wait) == -1)
+ while ((loop == 0) && (nanosleep (&ts_wait, &ts_wait) == -1))
{
if (errno != EINTR)
{
{
if (errno != EINTR)
{
#endif
start_client ();
#endif
start_client ();
+ plugin_shutdown_all ();
+
#if COLLECT_DEBUG
if (logfile != NULL)
DBG_STOPFILE("debug file closed.");
#if COLLECT_DEBUG
if (logfile != NULL)
DBG_STOPFILE("debug file closed.");