plugins: Implement a first version of the new plugin mechanismn.
[collectd.git] / src / collectd.c
index 98b9a16..6e71110 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)
                        {
@@ -224,6 +224,8 @@ static int start_client (void)
 static int start_server (void)
 {
        /* FIXME use stack here! */
+       /* FIXME */
+#if 0
        char *host;
        char *type;
        char *instance;
@@ -240,6 +242,7 @@ static int start_server (void)
                if (values   != NULL) free (values);   values   = NULL;
        }
        
+#endif
        return (0);
 } /* static int start_server (void) */
 #endif /* HAVE_LIBRRD */
@@ -444,6 +447,8 @@ int main (int argc, char **argv)
 #endif
                start_client ();
 
+       plugin_shutdown_all ();
+
 #if COLLECT_DEBUG
        if (logfile != NULL)
                DBG_STOPFILE("debug file closed.");