Skip to content

Commit

Permalink
nonblock: call with (void) to show we ignore the return code
Browse files Browse the repository at this point in the history
Coverity pointed out several of these.
  • Loading branch information
bagder committed Oct 4, 2014
1 parent a60825f commit d94717e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/connect.c
Expand Up @@ -1050,7 +1050,7 @@ singleipconnect(struct connectdata *conn,
}

/* set socket non-blocking */
curlx_nonblock(sockfd, TRUE);
(void)curlx_nonblock(sockfd, TRUE);

conn->connecttime = Curl_tvnow();
if(conn->num_addr > 1)
Expand Down
2 changes: 1 addition & 1 deletion lib/curl_rtmp.c
Expand Up @@ -217,7 +217,7 @@ static CURLcode rtmp_connect(struct connectdata *conn, bool *done)
!(r->Link.protocol & RTMP_FEATURE_HTTP))
r->Link.lFlags |= RTMP_LF_BUFX;

curlx_nonblock(r->m_sb.sb_socket, FALSE);
(void)curlx_nonblock(r->m_sb.sb_socket, FALSE);
setsockopt(r->m_sb.sb_socket, SOL_SOCKET, SO_RCVTIMEO,
(char *)&tv, sizeof(tv));

Expand Down
2 changes: 1 addition & 1 deletion lib/ftp.c
Expand Up @@ -346,7 +346,7 @@ static CURLcode AcceptServerConnect(struct connectdata *conn)
infof(data, "Connection accepted from server\n");

conn->sock[SECONDARYSOCKET] = s;
curlx_nonblock(s, TRUE); /* enable non-blocking */
(void)curlx_nonblock(s, TRUE); /* enable non-blocking */
conn->sock_accepted[SECONDARYSOCKET] = TRUE;

if(data->set.fsockopt) {
Expand Down
16 changes: 8 additions & 8 deletions lib/socks.c
Expand Up @@ -5,7 +5,7 @@
* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
* Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al.
* Copyright (C) 1998 - 2014, 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
Expand Down Expand Up @@ -127,7 +127,7 @@ CURLcode Curl_SOCKS4(const char *proxy_name,
return CURLE_OPERATION_TIMEDOUT;
}

curlx_nonblock(sock, FALSE);
(void)curlx_nonblock(sock, FALSE);

infof(data, "SOCKS4 communication to %s:%d\n", hostname, remote_port);

Expand Down Expand Up @@ -335,7 +335,7 @@ CURLcode Curl_SOCKS4(const char *proxy_name,
}
}

curlx_nonblock(sock, TRUE);
(void)curlx_nonblock(sock, TRUE);

return CURLE_OK; /* Proxy was successful! */
}
Expand Down Expand Up @@ -396,7 +396,7 @@ CURLcode Curl_SOCKS5(const char *proxy_name,
return CURLE_OPERATION_TIMEDOUT;
}

curlx_nonblock(sock, TRUE);
(void)curlx_nonblock(sock, TRUE);

/* wait until socket gets connected */
result = Curl_socket_ready(CURL_SOCKET_BAD, sock, timeout);
Expand Down Expand Up @@ -427,7 +427,7 @@ CURLcode Curl_SOCKS5(const char *proxy_name,
socksreq[3] = 2; /* username/password */
#endif

curlx_nonblock(sock, FALSE);
(void)curlx_nonblock(sock, FALSE);

code = Curl_write_plain(conn, sock, (char *)socksreq, (2 + (int)socksreq[1]),
&written);
Expand All @@ -436,7 +436,7 @@ CURLcode Curl_SOCKS5(const char *proxy_name,
return CURLE_COULDNT_CONNECT;
}

curlx_nonblock(sock, TRUE);
(void)curlx_nonblock(sock, TRUE);

result = Curl_socket_ready(sock, CURL_SOCKET_BAD, timeout);

Expand All @@ -454,7 +454,7 @@ CURLcode Curl_SOCKS5(const char *proxy_name,
return CURLE_RECV_ERROR;
}

curlx_nonblock(sock, FALSE);
(void)curlx_nonblock(sock, FALSE);

result=Curl_blockread_all(conn, sock, (char *)socksreq, 2, &actualread);
if((result != CURLE_OK) || (actualread != 2)) {
Expand Down Expand Up @@ -747,7 +747,7 @@ CURLcode Curl_SOCKS5(const char *proxy_name,
}
#endif

curlx_nonblock(sock, TRUE);
(void)curlx_nonblock(sock, TRUE);
return CURLE_OK; /* Proxy was successful! */
}

Expand Down

0 comments on commit d94717e

Please sign in to comment.