From: Florian Forster Date: Mon, 5 Apr 2010 14:32:45 +0000 (+0200) Subject: network plugin: Be more strict when checking the return value of "setsockopt". X-Git-Tag: collectd-4.8.4~3 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=6852f0596e8fc9b0dfb00b214f01a7acc077b42e;p=collectd.git network plugin: Be more strict when checking the return value of "setsockopt". --- diff --git a/src/network.c b/src/network.c index ac692546..a5305056 100644 --- a/src/network.c +++ b/src/network.c @@ -1529,7 +1529,7 @@ static int network_set_ttl (const sockent_t *se, const struct addrinfo *ai) if (setsockopt (se->data.client.fd, IPPROTO_IP, optname, &network_config_ttl, - sizeof (network_config_ttl)) == -1) + sizeof (network_config_ttl)) != 0) { char errbuf[1024]; ERROR ("setsockopt: %s", @@ -1550,7 +1550,7 @@ static int network_set_ttl (const sockent_t *se, const struct addrinfo *ai) if (setsockopt (se->data.client.fd, IPPROTO_IPV6, optname, &network_config_ttl, - sizeof (network_config_ttl)) == -1) + sizeof (network_config_ttl)) != 0) { char errbuf[1024]; ERROR ("setsockopt: %s",