From: Florian Forster Date: Sat, 23 Feb 2008 09:56:37 +0000 (+0100) Subject: ping plugin: Deactivate the plugin if (pingobj == NULL). X-Git-Tag: collectd-4.2.5~16 X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=cbf7250b4113c9058654d91b6199814741a06ca9;p=collectd.git ping plugin: Deactivate the plugin if (pingobj == NULL). If (pingobj == NULL), then the init-function will return (-1) so that the plugin is deactivated. --- diff --git a/src/ping.c b/src/ping.c index 27a65faa..05f660b3 100644 --- a/src/ping.c +++ b/src/ping.c @@ -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) {