diff options
author | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-10-23 16:41:33 +0300 |
---|---|---|
committer | Evgeny Grin (Karlson2k) <k2k@narod.ru> | 2021-10-23 16:41:33 +0300 |
commit | 07829e8544c893e4b278eaf9b091d3f6d9b3eaba (patch) | |
tree | d01ff2706df2be8215ede3c66e8b989162b7bd03 | |
parent | 916886cdf6b64cd94f89de45c886fae5ec80bf65 (diff) |
test_add_conn: used the better way to mute compiler and analyzer warnings
-rw-r--r-- | src/testcurl/test_add_conn.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/testcurl/test_add_conn.c b/src/testcurl/test_add_conn.c index 1c6b3adf..9bd7964f 100644 --- a/src/testcurl/test_add_conn.c +++ b/src/testcurl/test_add_conn.c @@ -1053,12 +1053,11 @@ testStopRace (enum testMhdPollType pollType) MHD_socket fd2; struct addConnParam aParam; int ret = 0; /* Return value of the test */ - const int c_no_listen = no_listen; /* Local const value to mute analyzer */ d = startTestMhdDaemon (testMhdThreadInternal, pollType, &d_port); - if (! c_no_listen) + if (! no_listen) { fd1 = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP); if (MHD_INVALID_SOCKET == fd1) @@ -1071,6 +1070,8 @@ testStopRace (enum testMhdPollType pollType) if (connect (fd1, (struct sockaddr *) (&sin), sizeof(sin)) < 0) externalErrorExitDesc ("socket() failed"); } + else + fd1 = MHD_INVALID_SOCKET; aParam.d = d; aParam.lstn_sk = createListeningSocket (&a_port); /* Sets a_port */ @@ -1092,7 +1093,7 @@ testStopRace (enum testMhdPollType pollType) MHD_stop_daemon (d); - if (! c_no_listen) + if (MHD_INVALID_SOCKET != fd1) (void) MHD_socket_close_ (fd1); (void) MHD_socket_close_ (aParam.lstn_sk); (void) MHD_socket_close_ (fd2); |