X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=src%2Fping.c;h=2f7c064d1871363f3199a8deb581a2681e9ff51d;hb=bc70ba89dba0b54cb595b945e2667bf04a1abed1;hp=27a65faafc36f23a14118ac61a04353acc48704f;hpb=14b7c735bf93b5a6260a0e064bccc28dc7581c7f;p=collectd.git diff --git a/src/ping.c b/src/ping.c index 27a65faa..2f7c064d 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) { @@ -159,7 +162,7 @@ static int ping_config (const char *key, const char *value) else if (strcasecmp (key, "ttl") == 0) { int ttl = atoi (value); - if (ping_setopt (pingobj, PING_DEF_TIMEOUT, (void *) &ttl)) + if (ping_setopt (pingobj, PING_OPT_TTL, (void *) &ttl)) { WARNING ("ping: liboping did not accept the TTL value %i", ttl); return (1);