diff options
author | Daniel Stenberg <daniel@haxx.se> | 2021-01-11 00:13:01 +0100 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2021-01-11 00:15:03 +0100 |
commit | 7bf0b367b8be82507e29c9703512cbb906bef7a7 (patch) | |
tree | 5e2644001c41053cdd79569b894a8478b82affb5 | |
parent | 8b2dec6ab771c74815ae6d3358c8e58cf7815f23 (diff) | |
download | curl-bagder/connect-setsockopt.tar.gz |
connect: mark intentional ignores of setsockopt return valuesbagder/connect-setsockopt
Pointed out by Coverity
-rw-r--r-- | lib/connect.c | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/lib/connect.c b/lib/connect.c index f7aa26019..345b800ee 100644 --- a/lib/connect.c +++ b/lib/connect.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2020, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2021, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -445,7 +445,7 @@ static CURLcode bindlocal(struct connectdata *conn, } } #ifdef IP_BIND_ADDRESS_NO_PORT - setsockopt(sockfd, SOL_IP, IP_BIND_ADDRESS_NO_PORT, &on, sizeof(on)); + (void)setsockopt(sockfd, SOL_IP, IP_BIND_ADDRESS_NO_PORT, &on, sizeof(on)); #endif for(;;) { if(bind(sockfd, sock, sizeof_sa) >= 0) { @@ -1578,18 +1578,17 @@ CURLcode Curl_socket(struct connectdata *conn, if(addr->socktype == SOCK_DGRAM) { int one = 1; switch(addr->family) { - case AF_INET: - setsockopt(*sockfd, SOL_IP, IP_RECVERR, &one, sizeof(one)); - break; - case AF_INET6: - setsockopt(*sockfd, SOL_IPV6, IPV6_RECVERR, &one, sizeof(one)); - break; + case AF_INET: + (void)setsockopt(*sockfd, SOL_IP, IP_RECVERR, &one, sizeof(one)); + break; + case AF_INET6: + (void)setsockopt(*sockfd, SOL_IPV6, IPV6_RECVERR, &one, sizeof(one)); + break; } } #endif return CURLE_OK; - } /* |