summaryrefslogtreecommitdiff
path: root/src/journal-remote
diff options
context:
space:
mode:
authorEvgeny Vereshchagin <evvers@ya.ru>2017-02-01 12:02:50 +0300
committerGitHub <noreply@github.com>2017-02-01 12:02:50 +0300
commitb5267219ddd327207128b3e311f29eac232c6dde (patch)
tree1672e02ca6d0caa73ffb0e73b998bda6e106726d /src/journal-remote
parenta38d90c672adf85cc3d164326efd26b361222f48 (diff)
parent6154d33de3f15bbd5d5df718103af9c37ba0a768 (diff)
Merge pull request #5166 from keszybz/gcc7
Fixes for gcc 7 and new µhttpd & glibc warnings
Diffstat (limited to 'src/journal-remote')
-rw-r--r--src/journal-remote/journal-gatewayd.c9
-rw-r--r--src/journal-remote/journal-remote.c4
-rw-r--r--src/journal-remote/microhttpd-util.h16
3 files changed, 20 insertions, 9 deletions
diff --git a/src/journal-remote/journal-gatewayd.c b/src/journal-remote/journal-gatewayd.c
index f86b67faa2..9a1c5b76ca 100644
--- a/src/journal-remote/journal-gatewayd.c
+++ b/src/journal-remote/journal-gatewayd.c
@@ -1029,10 +1029,9 @@ int main(int argc, char *argv[]) {
{ MHD_OPTION_END, 0, NULL }};
int opts_pos = 2;
- /* We force MHD_USE_PIPE_FOR_SHUTDOWN here, in order
- * to make sure libmicrohttpd doesn't use shutdown()
- * on our listening socket, which would break socket
- * re-activation. See
+ /* We force MHD_USE_ITC here, in order to make sure
+ * libmicrohttpd doesn't use shutdown() on our listening
+ * socket, which would break socket re-activation. See
*
* https://lists.gnu.org/archive/html/libmicrohttpd/2015-09/msg00014.html
* https://github.com/systemd/systemd/pull/1286
@@ -1041,7 +1040,7 @@ int main(int argc, char *argv[]) {
int flags =
MHD_USE_DEBUG |
MHD_USE_DUAL_STACK |
- MHD_USE_PIPE_FOR_SHUTDOWN |
+ MHD_USE_ITC |
MHD_USE_POLL |
MHD_USE_THREAD_PER_CONNECTION;
diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c
index d86c3681b1..d0d8d936e3 100644
--- a/src/journal-remote/journal-remote.c
+++ b/src/journal-remote/journal-remote.c
@@ -648,9 +648,9 @@ static int setup_microhttpd_server(RemoteServer *s,
int flags =
MHD_USE_DEBUG |
MHD_USE_DUAL_STACK |
- MHD_USE_EPOLL_LINUX_ONLY |
+ MHD_USE_EPOLL |
MHD_USE_PEDANTIC_CHECKS |
- MHD_USE_PIPE_FOR_SHUTDOWN;
+ MHD_USE_ITC;
const union MHD_DaemonInfo *info;
int r, epoll_fd;
diff --git a/src/journal-remote/microhttpd-util.h b/src/journal-remote/microhttpd-util.h
index af26ab69fe..49def4f630 100644
--- a/src/journal-remote/microhttpd-util.h
+++ b/src/journal-remote/microhttpd-util.h
@@ -24,13 +24,25 @@
#include "macro.h"
+/* Those defines are added when options are renamed, hence the check for the *old* name. */
+
/* Compatiblity with libmicrohttpd < 0.9.38 */
#ifndef MHD_HTTP_NOT_ACCEPTABLE
-#define MHD_HTTP_NOT_ACCEPTABLE MHD_HTTP_METHOD_NOT_ACCEPTABLE
+# define MHD_HTTP_NOT_ACCEPTABLE MHD_HTTP_METHOD_NOT_ACCEPTABLE
+#endif
+
+/* Renamed in µhttpd 0.9.52 */
+#ifndef MHD_USE_EPOLL_LINUX_ONLY
+# define MHD_USE_EPOLL MHD_USE_EPOLL_LINUX_ONLY
+#endif
+
+/* Renamed in µhttpd 0.9.51 */
+#ifndef MHD_USE_PIPE_FOR_SHUTDOWN
+# define MHD_USE_ITC MHD_USE_PIPE_FOR_SHUTDOWN
#endif
#if MHD_VERSION < 0x00094203
-#define MHD_create_response_from_fd_at_offset64 MHD_create_response_from_fd_at_offset
+# define MHD_create_response_from_fd_at_offset64 MHD_create_response_from_fd_at_offset
#endif
void microhttpd_logger(void *arg, const char *fmt, va_list ap) _printf_(2, 0);