Code

src/Makefile.am: Added utils_dns.h to dns_la_SOURCES.
[collectd.git] / src / collectd.c
index 98b9a1623f77b8840e6dbf36dbd7cfa4c69b2f1e..a1e15bf1e7ca52b674632b1308012c91297d2c00 100644 (file)
@@ -193,7 +193,7 @@ static int start_client (void)
                curtime = time (NULL);
 
                /* Issue all plugins */
-               plugin_read_all ();
+               plugin_read_all (&loop);
 
                if (gettimeofday (&tv_now, NULL) < 0)
                {
@@ -207,7 +207,7 @@ static int start_client (void)
                        continue;
                }
 
-               while (nanosleep (&ts_wait, &ts_wait) == -1)
+               while ((loop == 0) && (nanosleep (&ts_wait, &ts_wait) == -1))
                {
                        if (errno != EINTR)
                        {
@@ -444,6 +444,8 @@ int main (int argc, char **argv)
 #endif
                start_client ();
 
+       plugin_shutdown_all ();
+
 #if COLLECT_DEBUG
        if (logfile != NULL)
                DBG_STOPFILE("debug file closed.");