aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorMarc Hoersken <info@marc-hoersken.de>2020-03-12 09:32:50 +0100
committerMarc Hoersken <info@marc-hoersken.de>2020-03-15 11:08:27 +0100
commit041e778f1e864f57d98757704378acb14c9d873e (patch)
treee145c9083bfbfda30c259104e5430eadc0b3239d /lib
parentc52b3420510301a62ce6a209720d57f8f41413a4 (diff)
select: fix 'pending_ms' is assigned a value that is never used
Detected by Codacy
Diffstat (limited to 'lib')
-rw-r--r--lib/select.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/select.c b/lib/select.c
index b9d7d6569..bbada45fc 100644
--- a/lib/select.c
+++ b/lib/select.c
@@ -119,7 +119,7 @@ int Curl_select(curl_socket_t maxfd,
{
struct timeval pending_tv;
struct timeval *ptimeout;
- int pending_ms = 0;
+ int pending_ms;
int r;
#ifdef USE_WINSOCK
@@ -197,7 +197,7 @@ int Curl_socket_check(curl_socket_t readfd0, /* two sockets to read from */
{
#ifdef HAVE_POLL_FINE
struct pollfd pfd[3];
- int pending_ms = 0;
+ int pending_ms;
int num;
#else
fd_set fds_read;
@@ -252,7 +252,7 @@ int Curl_socket_check(curl_socket_t readfd0, /* two sockets to read from */
pending_ms = (int)timeout_ms;
else if(timeout_ms < 0)
pending_ms = -1;
- else if(!timeout_ms)
+ else
pending_ms = 0;
r = poll(pfd, num, pending_ms);
@@ -374,7 +374,7 @@ int Curl_socket_check(curl_socket_t readfd0, /* two sockets to read from */
int Curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms)
{
#ifdef HAVE_POLL_FINE
- int pending_ms = 0;
+ int pending_ms;
#else
fd_set fds_read;
fd_set fds_write;
@@ -409,7 +409,7 @@ int Curl_poll(struct pollfd ufds[], unsigned int nfds, int timeout_ms)
pending_ms = timeout_ms;
else if(timeout_ms < 0)
pending_ms = -1;
- else if(!timeout_ms)
+ else
pending_ms = 0;
r = poll(ufds, nfds, pending_ms);