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.10.0~21 X-Git-Url: https://git.octo.it/?p=collectd.git;a=commitdiff_plain;h=2048b4ee2c360726f610c321095868a2e87226cd network plugin: Be more strict when checking the return value of "setsockopt". --- diff --git a/src/network.c b/src/network.c index af4a117c..96053a13 100644 --- a/src/network.c +++ b/src/network.c @@ -1621,7 +1621,7 @@ static int network_set_interface (const sockent_t *se, const struct addrinfo *ai #endif if (setsockopt (se->data.client.fd, IPPROTO_IP, IP_MULTICAST_IF, - &mreq, sizeof (mreq)) == -1) + &mreq, sizeof (mreq)) != 0) { char errbuf[1024]; ERROR ("setsockopt: %s", @@ -1640,7 +1640,7 @@ static int network_set_interface (const sockent_t *se, const struct addrinfo *ai { if (setsockopt (se->data.client.fd, IPPROTO_IPV6, IPV6_MULTICAST_IF, &se->interface, - sizeof (se->interface)) == -1) + sizeof (se->interface)) != 0) { char errbuf[1024]; ERROR ("setsockopt: %s",