Code

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:34:55 +0000 (16:34 +0200)
src/network.c

index ac6925468096f46d82627ff797353a4cb1168b5b..a530505628803262c8d1e40ae3789557f72feae5 100644 (file)
@@ -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",