aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-10-23 16:41:33 +0300
committerEvgeny Grin (Karlson2k) <k2k@narod.ru>2021-10-23 16:41:33 +0300
commit07829e8544c893e4b278eaf9b091d3f6d9b3eaba (patch)
treed01ff2706df2be8215ede3c66e8b989162b7bd03
parent916886cdf6b64cd94f89de45c886fae5ec80bf65 (diff)
downloadlibmicrohttpd-07829e8544c893e4b278eaf9b091d3f6d9b3eaba.tar.gz
libmicrohttpd-07829e8544c893e4b278eaf9b091d3f6d9b3eaba.zip
test_add_conn: used the better way to mute compiler and analyzer warnings
-rw-r--r--src/testcurl/test_add_conn.c7
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)
1053 MHD_socket fd2; 1053 MHD_socket fd2;
1054 struct addConnParam aParam; 1054 struct addConnParam aParam;
1055 int ret = 0; /* Return value of the test */ 1055 int ret = 0; /* Return value of the test */
1056 const int c_no_listen = no_listen; /* Local const value to mute analyzer */
1057 1056
1058 d = startTestMhdDaemon (testMhdThreadInternal, pollType, 1057 d = startTestMhdDaemon (testMhdThreadInternal, pollType,
1059 &d_port); 1058 &d_port);
1060 1059
1061 if (! c_no_listen) 1060 if (! no_listen)
1062 { 1061 {
1063 fd1 = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP); 1062 fd1 = socket (PF_INET, SOCK_STREAM, IPPROTO_TCP);
1064 if (MHD_INVALID_SOCKET == fd1) 1063 if (MHD_INVALID_SOCKET == fd1)
@@ -1071,6 +1070,8 @@ testStopRace (enum testMhdPollType pollType)
1071 if (connect (fd1, (struct sockaddr *) (&sin), sizeof(sin)) < 0) 1070 if (connect (fd1, (struct sockaddr *) (&sin), sizeof(sin)) < 0)
1072 externalErrorExitDesc ("socket() failed"); 1071 externalErrorExitDesc ("socket() failed");
1073 } 1072 }
1073 else
1074 fd1 = MHD_INVALID_SOCKET;
1074 1075
1075 aParam.d = d; 1076 aParam.d = d;
1076 aParam.lstn_sk = createListeningSocket (&a_port); /* Sets a_port */ 1077 aParam.lstn_sk = createListeningSocket (&a_port); /* Sets a_port */
@@ -1092,7 +1093,7 @@ testStopRace (enum testMhdPollType pollType)
1092 1093
1093 MHD_stop_daemon (d); 1094 MHD_stop_daemon (d);
1094 1095
1095 if (! c_no_listen) 1096 if (MHD_INVALID_SOCKET != fd1)
1096 (void) MHD_socket_close_ (fd1); 1097 (void) MHD_socket_close_ (fd1);
1097 (void) MHD_socket_close_ (aParam.lstn_sk); 1098 (void) MHD_socket_close_ (aParam.lstn_sk);
1098 (void) MHD_socket_close_ (fd2); 1099 (void) MHD_socket_close_ (fd2);