gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] 02/02: test_add_conn: used the better way to mute compil


From: gnunet
Subject: [libmicrohttpd] 02/02: test_add_conn: used the better way to mute compiler and analyzer warnings
Date: Sat, 23 Oct 2021 15:42:08 +0200

This is an automated email from the git hooks/post-receive script.

karlson2k pushed a commit to branch master
in repository libmicrohttpd.

commit 07829e8544c893e4b278eaf9b091d3f6d9b3eaba
Author: Evgeny Grin (Karlson2k) <k2k@narod.ru>
AuthorDate: Sat Oct 23 16:41:33 2021 +0300

    test_add_conn: used the better way to mute compiler and analyzer warnings
---
 src/testcurl/test_add_conn.c | 7 ++++---
 1 file 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);

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]