network plugin: Be more strict when checking the return value of "setsockopt".
authorFlorian Forster <octo@leeloo.lan.home.verplant.org>
Mon, 5 Apr 2010 14:32:45 +0000 (16:32 +0200)
committerFlorian Forster <octo@leeloo.lan.home.verplant.org>
Mon, 5 Apr 2010 14:32:45 +0000 (16:32 +0200)
src/network.c

index af4a117..96053a1 100644 (file)
@@ -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",