commit 605e35bb6e2c9b29067b2fdf5d7d28ac8a475aba
parent b4afd3fce6bd3bb8470385ca153e7a520c9ace0a
Author: Christian Grothoff <christian@grothoff.org>
Date: Sat, 18 Aug 2018 13:26:30 +0200
style fixes
Diffstat:
4 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/src/examples/timeout.c b/src/examples/timeout.c
@@ -78,7 +78,7 @@ main (void)
MHD_OPTION_END);
if (NULL == daemon)
return 1;
- getchar();
- MHD_stop_daemon(daemon);
+ (void) getchar();
+ MHD_stop_daemon (daemon);
return 0;
}
diff --git a/src/include/microhttpd.h b/src/include/microhttpd.h
@@ -2595,9 +2595,9 @@ MHD_suspend_connection (struct MHD_Connection *connection);
* result in undefined behavior.
*
* If you are using this function in ``external'' select mode, you must
- * make sure to run #MHD_run() and #MHD_get_timeout() afterwards (before
+ * make sure to run #MHD_run() and #MHD_get_timeout() afterwards (before
* again calling #MHD_get_fdset()), as otherwise the change may not be
- * reflected in the set returned by #MHD_get_fdset() and you may end up
+ * reflected in the set returned by #MHD_get_fdset() and you may end up
* with a connection that is stuck until the next network activity.
*
* @param connection the connection to resume
diff --git a/src/microhttpd/test_upgrade.c b/src/microhttpd/test_upgrade.c
@@ -103,8 +103,10 @@ gnutlscli_connect (int *sock,
MHD_socket_close_chk_ (sp[1]);
(void) close (0);
(void) close (1);
- dup2 (sp[0], 0);
- dup2 (sp[0], 1);
+ if (-1 == dup2 (sp[0], 0))
+ abort ();
+ if (-1 == dup2 (sp[0], 1))
+ abort ();
MHD_socket_close_chk_ (sp[0]);
if (TLS_CLI_GNUTLS == use_tls_tool)
{
@@ -946,6 +948,7 @@ run_mhd_epoll_loop (struct MHD_Daemon *daemon)
fd_set rs;
MHD_UNSIGNED_LONG_LONG to;
struct timeval tv;
+ int ret;
di = MHD_get_daemon_info (daemon,
MHD_DAEMON_INFO_EPOLL_FD);
@@ -962,11 +965,15 @@ run_mhd_epoll_loop (struct MHD_Daemon *daemon)
to = 1000;
tv.tv_sec = to / 1000;
tv.tv_usec = 1000 * (to % 1000);
- select (ep + 1,
- &rs,
- NULL,
- NULL,
- &tv);
+ ret = select (ep + 1,
+ &rs,
+ NULL,
+ NULL,
+ &tv);
+ if ( (-1 == ret) &&
+ (EAGAIN != errno) &&
+ (EINTR != errno) )
+ abort ();
MHD_run (daemon);
}
}
diff --git a/src/testcurl/test_get_sendfile.c b/src/testcurl/test_get_sendfile.c
@@ -596,7 +596,9 @@ main (int argc, char *const *argv)
free (sourcefile);
return 1;
}
- fwrite (TESTSTR, strlen (TESTSTR), 1, f);
+ if (strlen (TESTSTR) !=
+ fwrite (TESTSTR, strlen (TESTSTR), 1, f))
+ abort ();
fclose (f);
if (0 != curl_global_init (CURL_GLOBAL_WIN32))
return 2;