aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2018-08-18 13:26:30 +0200
committerChristian Grothoff <christian@grothoff.org>2018-08-18 13:26:38 +0200
commit605e35bb6e2c9b29067b2fdf5d7d28ac8a475aba (patch)
tree8c8c539feb03117f3785213169b26c00d8288eb2
parentb4afd3fce6bd3bb8470385ca153e7a520c9ace0a (diff)
downloadlibmicrohttpd-605e35bb6e2c9b29067b2fdf5d7d28ac8a475aba.tar.gz
libmicrohttpd-605e35bb6e2c9b29067b2fdf5d7d28ac8a475aba.zip
style fixes
-rw-r--r--src/examples/timeout.c4
-rw-r--r--src/include/microhttpd.h4
-rw-r--r--src/microhttpd/test_upgrade.c21
-rw-r--r--src/testcurl/test_get_sendfile.c4
4 files changed, 21 insertions, 12 deletions
diff --git a/src/examples/timeout.c b/src/examples/timeout.c
index b9569547..91de1599 100644
--- a/src/examples/timeout.c
+++ b/src/examples/timeout.c
@@ -78,7 +78,7 @@ main (void)
78 MHD_OPTION_END); 78 MHD_OPTION_END);
79 if (NULL == daemon) 79 if (NULL == daemon)
80 return 1; 80 return 1;
81 getchar(); 81 (void) getchar();
82 MHD_stop_daemon(daemon); 82 MHD_stop_daemon (daemon);
83 return 0; 83 return 0;
84} 84}
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
index e1a8d215..dae41fba 100644
--- a/src/include/microhttpd.h
+++ b/src/include/microhttpd.h
@@ -2595,9 +2595,9 @@ MHD_suspend_connection (struct MHD_Connection *connection);
2595 * result in undefined behavior. 2595 * result in undefined behavior.
2596 * 2596 *
2597 * If you are using this function in ``external'' select mode, you must 2597 * If you are using this function in ``external'' select mode, you must
2598 * make sure to run #MHD_run() and #MHD_get_timeout() afterwards (before 2598 * make sure to run #MHD_run() and #MHD_get_timeout() afterwards (before
2599 * again calling #MHD_get_fdset()), as otherwise the change may not be 2599 * again calling #MHD_get_fdset()), as otherwise the change may not be
2600 * reflected in the set returned by #MHD_get_fdset() and you may end up 2600 * reflected in the set returned by #MHD_get_fdset() and you may end up
2601 * with a connection that is stuck until the next network activity. 2601 * with a connection that is stuck until the next network activity.
2602 * 2602 *
2603 * @param connection the connection to resume 2603 * @param connection the connection to resume
diff --git a/src/microhttpd/test_upgrade.c b/src/microhttpd/test_upgrade.c
index a0703441..caf12e61 100644
--- a/src/microhttpd/test_upgrade.c
+++ b/src/microhttpd/test_upgrade.c
@@ -103,8 +103,10 @@ gnutlscli_connect (int *sock,
103 MHD_socket_close_chk_ (sp[1]); 103 MHD_socket_close_chk_ (sp[1]);
104 (void) close (0); 104 (void) close (0);
105 (void) close (1); 105 (void) close (1);
106 dup2 (sp[0], 0); 106 if (-1 == dup2 (sp[0], 0))
107 dup2 (sp[0], 1); 107 abort ();
108 if (-1 == dup2 (sp[0], 1))
109 abort ();
108 MHD_socket_close_chk_ (sp[0]); 110 MHD_socket_close_chk_ (sp[0]);
109 if (TLS_CLI_GNUTLS == use_tls_tool) 111 if (TLS_CLI_GNUTLS == use_tls_tool)
110 { 112 {
@@ -946,6 +948,7 @@ run_mhd_epoll_loop (struct MHD_Daemon *daemon)
946 fd_set rs; 948 fd_set rs;
947 MHD_UNSIGNED_LONG_LONG to; 949 MHD_UNSIGNED_LONG_LONG to;
948 struct timeval tv; 950 struct timeval tv;
951 int ret;
949 952
950 di = MHD_get_daemon_info (daemon, 953 di = MHD_get_daemon_info (daemon,
951 MHD_DAEMON_INFO_EPOLL_FD); 954 MHD_DAEMON_INFO_EPOLL_FD);
@@ -962,11 +965,15 @@ run_mhd_epoll_loop (struct MHD_Daemon *daemon)
962 to = 1000; 965 to = 1000;
963 tv.tv_sec = to / 1000; 966 tv.tv_sec = to / 1000;
964 tv.tv_usec = 1000 * (to % 1000); 967 tv.tv_usec = 1000 * (to % 1000);
965 select (ep + 1, 968 ret = select (ep + 1,
966 &rs, 969 &rs,
967 NULL, 970 NULL,
968 NULL, 971 NULL,
969 &tv); 972 &tv);
973 if ( (-1 == ret) &&
974 (EAGAIN != errno) &&
975 (EINTR != errno) )
976 abort ();
970 MHD_run (daemon); 977 MHD_run (daemon);
971 } 978 }
972} 979}
diff --git a/src/testcurl/test_get_sendfile.c b/src/testcurl/test_get_sendfile.c
index fb040afe..6c44318a 100644
--- a/src/testcurl/test_get_sendfile.c
+++ b/src/testcurl/test_get_sendfile.c
@@ -596,7 +596,9 @@ main (int argc, char *const *argv)
596 free (sourcefile); 596 free (sourcefile);
597 return 1; 597 return 1;
598 } 598 }
599 fwrite (TESTSTR, strlen (TESTSTR), 1, f); 599 if (strlen (TESTSTR) !=
600 fwrite (TESTSTR, strlen (TESTSTR), 1, f))
601 abort ();
600 fclose (f); 602 fclose (f);
601 if (0 != curl_global_init (CURL_GLOBAL_WIN32)) 603 if (0 != curl_global_init (CURL_GLOBAL_WIN32))
602 return 2; 604 return 2;