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)
{
number_of_hosts++;
}
- if ((number_of_hosts == 0) && (getuid != 0))
+ if ((number_of_hosts == 0) && (getuid () != 0))
{
ERROR ("ping plugin: All hosts failed. Try starting collectd as root.");
}