summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/basic/MurmurHash2.c6
-rw-r--r--src/basic/nss-util.h6
-rw-r--r--src/basic/siphash24.c7
-rw-r--r--src/basic/time-util.c2
-rw-r--r--src/core/job.c2
-rw-r--r--src/core/socket.c1
-rw-r--r--src/core/timer.c3
-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
-rw-r--r--src/journal/journal-file.c2
-rw-r--r--src/journal/lookup3.c4
-rw-r--r--src/libsystemd-network/sd-dhcp6-client.c2
-rw-r--r--src/libsystemd/sd-device/sd-device.c2
-rw-r--r--src/nspawn/nspawn.c5
15 files changed, 49 insertions, 22 deletions
diff --git a/src/basic/MurmurHash2.c b/src/basic/MurmurHash2.c
index 9020793930..a282a21201 100644
--- a/src/basic/MurmurHash2.c
+++ b/src/basic/MurmurHash2.c
@@ -69,9 +69,9 @@ uint32_t MurmurHash2 ( const void * key, int len, uint32_t seed )
switch(len)
{
- case 3: h ^= data[2] << 16;
- case 2: h ^= data[1] << 8;
- case 1: h ^= data[0];
+ case 3: h ^= data[2] << 16; /* fall through */
+ case 2: h ^= data[1] << 8; /* fall through */
+ case 1: h ^= data[0]; /* fall through */
h *= m;
};
diff --git a/src/basic/nss-util.h b/src/basic/nss-util.h
index e7844fff96..9d927a8227 100644
--- a/src/basic/nss-util.h
+++ b/src/basic/nss-util.h
@@ -27,6 +27,10 @@
#define NSS_SIGNALS_BLOCK SIGALRM,SIGVTALRM,SIGPIPE,SIGCHLD,SIGTSTP,SIGIO,SIGHUP,SIGUSR1,SIGUSR2,SIGPROF,SIGURG,SIGWINCH
+#ifndef DEPRECATED_RES_USE_INET6
+# define DEPRECATED_RES_USE_INET6 0x00002000
+#endif
+
#define NSS_GETHOSTBYNAME_PROTOTYPES(module) \
enum nss_status _nss_##module##_gethostbyname4_r( \
const char *name, \
@@ -92,7 +96,7 @@ enum nss_status _nss_##module##_gethostbyname_r( \
int *errnop, int *h_errnop) { \
enum nss_status ret = NSS_STATUS_NOTFOUND; \
\
- if (_res.options & RES_USE_INET6) \
+ if (_res.options & DEPRECATED_RES_USE_INET6) \
ret = _nss_##module##_gethostbyname3_r( \
name, \
AF_INET6, \
diff --git a/src/basic/siphash24.c b/src/basic/siphash24.c
index 8c1cdc3db6..4bb41786c8 100644
--- a/src/basic/siphash24.c
+++ b/src/basic/siphash24.c
@@ -127,18 +127,25 @@ void siphash24_compress(const void *_in, size_t inlen, struct siphash *state) {
switch (left) {
case 7:
state->padding |= ((uint64_t) in[6]) << 48;
+ /* fall through */
case 6:
state->padding |= ((uint64_t) in[5]) << 40;
+ /* fall through */
case 5:
state->padding |= ((uint64_t) in[4]) << 32;
+ /* fall through */
case 4:
state->padding |= ((uint64_t) in[3]) << 24;
+ /* fall through */
case 3:
state->padding |= ((uint64_t) in[2]) << 16;
+ /* fall through */
case 2:
state->padding |= ((uint64_t) in[1]) << 8;
+ /* fall through */
case 1:
state->padding |= ((uint64_t) in[0]);
+ /* fall through */
case 0:
break;
}
diff --git a/src/basic/time-util.c b/src/basic/time-util.c
index 7a5b29d77e..1310c76336 100644
--- a/src/basic/time-util.c
+++ b/src/basic/time-util.c
@@ -1271,7 +1271,7 @@ bool clock_supported(clockid_t clock) {
if (!clock_boottime_supported())
return false;
- /* fall through, after checking the cached value for CLOCK_BOOTTIME. */
+ /* fall through */
default:
/* For everything else, check properly */
diff --git a/src/core/job.c b/src/core/job.c
index f7c4c59c32..00f7d7998f 100644
--- a/src/core/job.c
+++ b/src/core/job.c
@@ -697,7 +697,7 @@ _pure_ static const char *job_get_status_message_format(Unit *u, JobType t, JobR
static void job_print_status_message(Unit *u, JobType t, JobResult result) {
static const struct {
const char *color, *word;
- } const statuses[_JOB_RESULT_MAX] = {
+ } statuses[_JOB_RESULT_MAX] = {
[JOB_DONE] = { ANSI_GREEN, " OK " },
[JOB_TIMEOUT] = { ANSI_HIGHLIGHT_RED, " TIME " },
[JOB_FAILED] = { ANSI_HIGHLIGHT_RED, "FAILED" },
diff --git a/src/core/socket.c b/src/core/socket.c
index 3cae6b31bb..a7b9ada65c 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -2668,6 +2668,7 @@ const char* socket_port_type_to_string(SocketPort *p) {
if (socket_address_family(&p->address) == AF_NETLINK)
return "Netlink";
+ /* fall through */
default:
return NULL;
}
diff --git a/src/core/timer.c b/src/core/timer.c
index c6b28dd9c5..5ee14669d2 100644
--- a/src/core/timer.c
+++ b/src/core/timer.c
@@ -422,7 +422,8 @@ static void timer_enter_waiting(Timer *t, bool initial) {
}
/* In a container we don't want to include the time the host
* was already up when the container started, so count from
- * our own startup. Fall through. */
+ * our own startup. */
+ /* fall through */
case TIMER_STARTUP:
base = UNIT(t)->manager->userspace_timestamp.monotonic;
break;
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);
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index d3e0214731..e45d1905e7 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -285,7 +285,7 @@ static int journal_file_set_online(JournalFile *f) {
continue;
/* Canceled restart from offlining, must wait for offlining to complete however. */
- /* fall through to wait */
+ /* fall through */
default: {
int r;
diff --git a/src/journal/lookup3.c b/src/journal/lookup3.c
index d8f1a4977d..ec725ce46c 100644
--- a/src/journal/lookup3.c
+++ b/src/journal/lookup3.c
@@ -48,6 +48,10 @@ on 1 byte), but shoehorning those bytes into integers efficiently is messy.
# include <endian.h> /* attempt to define endianness */
#endif
+#if __GNUC__ >= 7
+_Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
+#endif
+
/*
* My best guess at if you are big-endian or little-endian. This may
* need adjustment.
diff --git a/src/libsystemd-network/sd-dhcp6-client.c b/src/libsystemd-network/sd-dhcp6-client.c
index e81215f7d7..6444b0ce94 100644
--- a/src/libsystemd-network/sd-dhcp6-client.c
+++ b/src/libsystemd-network/sd-dhcp6-client.c
@@ -999,7 +999,7 @@ static int client_receive_message(
break;
}
- /* fall through for Soliciation Rapid Commit option check */
+ /* fall through */ /* for Soliciation Rapid Commit option check */
case DHCP6_STATE_REQUEST:
case DHCP6_STATE_RENEW:
case DHCP6_STATE_REBIND:
diff --git a/src/libsystemd/sd-device/sd-device.c b/src/libsystemd/sd-device/sd-device.c
index bc5e92f8fe..efeadf0cd4 100644
--- a/src/libsystemd/sd-device/sd-device.c
+++ b/src/libsystemd/sd-device/sd-device.c
@@ -560,7 +560,7 @@ int device_read_uevent_file(sd_device *device) {
value = &uevent[i];
state = VALUE;
- /* fall through to handle empty property */
+ /* fall through */ /* to handle empty property */
case VALUE:
if (strchr(NEWLINE, uevent[i])) {
uevent[i] = '\0';
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index 532be148a6..4913907b69 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -676,9 +676,8 @@ static int parse_argv(int argc, char *argv[]) {
r = free_and_strdup(&arg_machine, optarg);
if (r < 0)
return log_oom();
-
- break;
}
+ break;
case 'Z':
arg_selinux_context = optarg;
@@ -1918,7 +1917,7 @@ static int wait_for_container(pid_t pid, ContainerStatus *container) {
return 0;
}
- /* CLD_KILLED fallthrough */
+ /* fall through */
case CLD_DUMPED:
log_error("Container %s terminated by signal %s.", arg_machine, signal_to_string(status.si_status));