Bladeren bron

tests: fixed some 'unused return value' compiler warnings

Evgeny Grin (Karlson2k) 8 jaren geleden
bovenliggende
commit
80ff0e1596

+ 1 - 1
src/testcurl/https/test_empty_response.c

@@ -181,7 +181,7 @@ testInternalSelectGet ()
             }
         }
       else
-        sleep (1);
+        (void)sleep (1);
       curl_multi_perform (multi, &running);
       if (running == 0)
         {

+ 1 - 1
src/testcurl/https/test_https_get_select.c

@@ -207,7 +207,7 @@ testExternalGet (int flags)
             }
         }
       else
-        sleep (1);
+        (void)sleep (1);
       curl_multi_perform (multi, &running);
       if (running == 0)
         {

+ 1 - 1
src/testcurl/https/test_https_time_out.c

@@ -84,7 +84,7 @@ test_tls_session_time_out (gnutls_session_t session, int port)
       return -1;
     }
 
-  sleep (TIME_OUT + 1);
+  (void)sleep (TIME_OUT + 1);
 
   /* check that server has closed the connection */
   /* TODO better RST trigger */

+ 3 - 3
src/testcurl/test_concurrent_stop.c

@@ -181,7 +181,7 @@ do_gets (void * param)
           _exit(99);
         }
     }
-  sleep (1);
+  (void)sleep (1);
   for (j=0;j<PAR;j++)
     {
       pthread_cancel(par[j]);
@@ -226,7 +226,7 @@ testMultithreadedGet (int port,
       port = (int)dinfo->port;
     }
   p = start_gets (port);
-  sleep (1);
+  (void)sleep (1);
   MHD_stop_daemon (d);
   pthread_join (p, NULL);
   return 0;
@@ -257,7 +257,7 @@ testMultithreadedPoolGet (int port,
       port = (int)dinfo->port;
     }
   p = start_gets (port);
-  sleep (1);
+  (void)sleep (1);
   MHD_stop_daemon (d);
   pthread_join (p, NULL);
   return 0;

+ 8 - 8
src/testcurl/test_get_response_cleanup.c

@@ -180,9 +180,9 @@ testInternalGet ()
     }
   sprintf(url, "http://127.0.0.1:%d/", port);
   curl = fork_curl (url);
-  sleep (1);
+  (void)sleep (1);
   kill_curl (curl);
-  sleep (1);
+  (void)sleep (1);
   // fprintf (stderr, "Stopping daemon!\n");
   MHD_stop_daemon (d);
   if (ok != 0)
@@ -226,11 +226,11 @@ testMultithreadedGet ()
   sprintf(url, "http://127.0.0.1:%d/", port);
   //fprintf (stderr, "Forking cURL!\n");
   curl = fork_curl (url);
-  sleep (1);
+  (void)sleep (1);
   kill_curl (curl);
-  sleep (1);
+  (void)sleep (1);
   curl = fork_curl (url);
-  sleep (1);
+  (void)sleep (1);
   if (ok != 0)
     {
       kill_curl (curl);
@@ -238,7 +238,7 @@ testMultithreadedGet ()
       return 64;
     }
   kill_curl (curl);
-  sleep (1);
+  (void)sleep (1);
   //fprintf (stderr, "Stopping daemon!\n");
   MHD_stop_daemon (d);
   if (ok != 0)
@@ -281,9 +281,9 @@ testMultithreadedPoolGet ()
     }
   sprintf(url, "http://127.0.0.1:%d/", port);
   curl = fork_curl (url);
-  sleep (1);
+  (void)sleep (1);
   kill_curl (curl);
-  sleep (1);
+  (void)sleep (1);
   //fprintf (stderr, "Stopping daemon!\n");
   MHD_stop_daemon (d);
   if (ok != 0)

+ 2 - 2
src/testcurl/test_iplimit.c

@@ -196,7 +196,7 @@ testMultithreadedGet ()
         return 32;
       }
 
-      sleep(2);
+      (void)sleep(2);
 
       for (i = 0; i < 2; ++i)
         {
@@ -310,7 +310,7 @@ testMultithreadedPoolGet ()
       for (i = 0; i < 3; ++i)
         curl_easy_cleanup (cenv[i]);
 
-      sleep(2);
+      (void)sleep(2);
 
       for (i = 0; i < 2; ++i)
         {

+ 1 - 1
src/testcurl/test_post.c

@@ -607,7 +607,7 @@ readBuffer(void *p, size_t size, size_t nmemb, void *opaque)
 static size_t
 slowReadBuffer(void *p, size_t size, size_t nmemb, void *opaque)
 {
-  sleep(1);
+  (void)sleep(1);
   return readBuffer(p, size, nmemb, opaque);
 }
 

+ 2 - 2
src/testcurl/test_quiesce_stream.c

@@ -215,14 +215,14 @@ main(void)
     }
   /* wait for a request */
   while (0 == request_counter)
-    sleep (1);
+    (void)sleep (1);
 
   fprintf (stderr,
            "quiesce\n");
   MHD_quiesce_daemon (daemon);
 
   /* wait a second */
-  sleep (1);
+  (void)sleep (1);
 
   fprintf (stderr,
            "stopping daemon\n");

+ 1 - 1
src/testcurl/test_termination.c

@@ -130,7 +130,7 @@ main ()
       exit (1);
     }
   /* CPU used to go crazy here */
-  sleep (1);
+  (void)sleep (1);
 
   curl_easy_cleanup (curl);
   MHD_stop_daemon (daemon);

+ 2 - 2
src/testzzuf/socat.c

@@ -73,7 +73,7 @@ zzuf_socat_start ()
     }
   if (zzuf_pid != 0)
     {
-      sleep (1);                /* allow zzuf and socat to start */
+      (void)sleep (1);                /* allow zzuf and socat to start */
       status = 0;
       if (0 < waitpid (zzuf_pid, &status, WNOHANG))
         {
@@ -106,7 +106,7 @@ zzuf_socat_stop ()
         fprintf (stderr, "Failed to killpg: %s\n", strerror (errno));
       kill (zzuf_pid, SIGINT);
       waitpid (zzuf_pid, &status, 0);
-      sleep (1);                /* allow socat to also die in peace */
+      (void)sleep (1);                /* allow socat to also die in peace */
     }
 }