Code

ping plugin: Deactivate the plugin if (pingobj == NULL).
[collectd.git] / src / ping.c
index 27a65faafc36f23a14118ac61a04353acc48704f..05f660b32bb6383d2fc55489d4230cc6e68ed1e1 100644 (file)
@@ -106,15 +106,18 @@ static void add_hosts (void)
                        hl_this = hl_this->next;
                }
        }
-}
+} /* void add_hosts */
 
 static int ping_init (void)
 {
+       if (pingobj == NULL)
+               return (-1);
+
        if (hosts != NULL)
                add_hosts ();
 
        return (0);
-}
+} /* int ping_init */
 
 static int ping_config (const char *key, const char *value)
 {