summaryrefslogtreecommitdiff
path: root/src/libsystemd
diff options
context:
space:
mode:
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/src/sd-bus/bus-bloom.c3
-rw-r--r--src/libsystemd/src/sd-bus/bus-container.c7
-rw-r--r--src/libsystemd/src/sd-bus/bus-convenience.c5
-rw-r--r--src/libsystemd/src/sd-bus/bus-creds.c7
-rw-r--r--src/libsystemd/src/sd-bus/bus-dump.c9
-rw-r--r--src/libsystemd/src/sd-bus/bus-error.c3
-rw-r--r--src/libsystemd/src/sd-bus/bus-internal.c5
-rw-r--r--src/libsystemd/src/sd-bus/bus-internal.h9
-rw-r--r--src/libsystemd/src/sd-bus/bus-introspect.c9
-rw-r--r--src/libsystemd/src/sd-bus/bus-match.c9
-rw-r--r--src/libsystemd/src/sd-bus/bus-message.c13
-rw-r--r--src/libsystemd/src/sd-bus/bus-message.h5
-rw-r--r--src/libsystemd/src/sd-bus/bus-objects.c9
-rw-r--r--src/libsystemd/src/sd-bus/bus-slot.c3
-rw-r--r--src/libsystemd/src/sd-bus/bus-socket.c7
-rw-r--r--src/libsystemd/src/sd-bus/bus-track.c3
-rw-r--r--src/libsystemd/src/sd-bus/sd-bus.c25
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-benchmark.c7
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-chat.c9
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-cleanup.c5
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-creds.c5
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-error.c5
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-introspect.c3
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-kernel-bloom.c5
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-kernel.c7
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-match.c7
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-objects.c9
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-server.c5
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-signature.c5
-rw-r--r--src/libsystemd/src/sd-bus/test-bus-zero-copy.c7
-rw-r--r--src/libsystemd/src/sd-device/device-enumerator.c8
-rw-r--r--src/libsystemd/src/sd-device/device-private.c10
-rw-r--r--src/libsystemd/src/sd-device/sd-device.c10
-rw-r--r--src/libsystemd/src/sd-hwdb/hwdb-util.h4
-rw-r--r--src/libsystemd/src/sd-hwdb/sd-hwdb.c8
-rw-r--r--src/libsystemd/src/sd-journal/audit-type.c2
-rw-r--r--src/libsystemd/src/sd-journal/catalog.c3
-rw-r--r--src/libsystemd/src/sd-journal/journal-authenticate.c3
-rw-r--r--src/libsystemd/src/sd-journal/journal-file.c14
-rw-r--r--src/libsystemd/src/sd-journal/journal-internal.h5
-rw-r--r--src/libsystemd/src/sd-journal/journal-vacuum.c7
-rw-r--r--src/libsystemd/src/sd-journal/journal-verify.c9
-rw-r--r--src/libsystemd/src/sd-journal/mmap-cache.c3
-rw-r--r--src/libsystemd/src/sd-journal/sd-journal.c13
-rw-r--r--src/libsystemd/src/sd-netlink/local-addresses.c6
-rw-r--r--src/libsystemd/src/sd-netlink/local-addresses.h4
-rw-r--r--src/libsystemd/src/sd-netlink/netlink-internal.h6
-rw-r--r--src/libsystemd/src/sd-netlink/netlink-message.c10
-rw-r--r--src/libsystemd/src/sd-netlink/netlink-socket.c10
-rw-r--r--src/libsystemd/src/sd-netlink/netlink-types.c21
-rw-r--r--src/libsystemd/src/sd-netlink/netlink-util.c3
-rw-r--r--src/libsystemd/src/sd-netlink/netlink-util.h4
-rw-r--r--src/libsystemd/src/sd-netlink/rtnl-message.c10
-rw-r--r--src/libsystemd/src/sd-netlink/sd-netlink.c8
-rw-r--r--src/libsystemd/src/sd-netlink/sd-netlink.h7
-rw-r--r--src/libsystemd/src/sd-netlink/test-local-addresses.c1
-rw-r--r--src/libsystemd/src/sd-netlink/test-netlink.c6
-rw-r--r--src/libsystemd/src/sd-network/network-util.c3
-rw-r--r--src/libsystemd/src/sd-network/sd-network.c4
-rw-r--r--src/libsystemd/src/sd-resolve/sd-resolve.c4
-rw-r--r--src/libsystemd/src/sd-resolve/sd-resolve.h3
-rw-r--r--src/libsystemd/src/sd-resolve/test-resolve.c4
62 files changed, 231 insertions, 192 deletions
diff --git a/src/libsystemd/src/sd-bus/bus-bloom.c b/src/libsystemd/src/sd-bus/bus-bloom.c
index d8bc9172f2..9327fb40c7 100644
--- a/src/libsystemd/src/sd-bus/bus-bloom.c
+++ b/src/libsystemd/src/sd-bus/bus-bloom.c
@@ -17,10 +17,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "bus-bloom.h"
#include "basic/siphash24.h"
#include "basic/util.h"
+#include "bus-bloom.h"
+
static inline void set_bit(uint64_t filter[], unsigned long b) {
filter[b >> 6] |= 1ULL << (b & 63);
}
diff --git a/src/libsystemd/src/sd-bus/bus-container.c b/src/libsystemd/src/sd-bus/bus-container.c
index 8eb0ee31be..43b9d03aa9 100644
--- a/src/libsystemd/src/sd-bus/bus-container.c
+++ b/src/libsystemd/src/sd-bus/bus-container.c
@@ -20,13 +20,14 @@
#include <fcntl.h>
#include <unistd.h>
-#include "bus-container.h"
-#include "bus-internal.h"
-#include "bus-socket.h"
#include "basic/fd-util.h"
#include "basic/process-util.h"
#include "basic/util.h"
+#include "bus-container.h"
+#include "bus-internal.h"
+#include "bus-socket.h"
+
int bus_container_connect_socket(sd_bus *b) {
_cleanup_close_pair_ int pair[2] = { -1, -1 };
_cleanup_close_ int pidnsfd = -1, mntnsfd = -1, usernsfd = -1, rootfd = -1;
diff --git a/src/libsystemd/src/sd-bus/bus-convenience.c b/src/libsystemd/src/sd-bus/bus-convenience.c
index 12fcc89d92..f76cbaf3d3 100644
--- a/src/libsystemd/src/sd-bus/bus-convenience.c
+++ b/src/libsystemd/src/sd-bus/bus-convenience.c
@@ -17,12 +17,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/string-util.h"
+#include "shared/bus-util.h"
+
#include "bus-internal.h"
#include "bus-message.h"
#include "bus-signature.h"
#include "bus-type.h"
-#include "shared/bus-util.h"
-#include "basic/string-util.h"
_public_ int sd_bus_emit_signal(
sd_bus *bus,
diff --git a/src/libsystemd/src/sd-bus/bus-creds.c b/src/libsystemd/src/sd-bus/bus-creds.c
index 30b80d88e0..3a93c59a7b 100644
--- a/src/libsystemd/src/sd-bus/bus-creds.c
+++ b/src/libsystemd/src/sd-bus/bus-creds.c
@@ -22,10 +22,7 @@
#include "basic/alloc-util.h"
#include "basic/audit-util.h"
-#include "bus-creds.h"
#include "basic/bus-label.h"
-#include "bus-message.h"
-#include "shared/bus-util.h"
#include "basic/capability-util.h"
#include "basic/cgroup-util.h"
#include "basic/fd-util.h"
@@ -39,6 +36,10 @@
#include "basic/terminal-util.h"
#include "basic/user-util.h"
#include "basic/util.h"
+#include "shared/bus-util.h"
+
+#include "bus-creds.h"
+#include "bus-message.h"
enum {
CAP_OFFSET_INHERITABLE = 0,
diff --git a/src/libsystemd/src/sd-bus/bus-dump.c b/src/libsystemd/src/sd-bus/bus-dump.c
index ed24e48495..cec53d75e5 100644
--- a/src/libsystemd/src/sd-bus/bus-dump.c
+++ b/src/libsystemd/src/sd-bus/bus-dump.c
@@ -18,10 +18,6 @@
***/
#include "basic/alloc-util.h"
-#include "bus-dump.h"
-#include "bus-internal.h"
-#include "bus-message.h"
-#include "bus-type.h"
#include "basic/cap-list.h"
#include "basic/capability-util.h"
#include "basic/fileio.h"
@@ -33,6 +29,11 @@
#include "basic/terminal-util.h"
#include "basic/util.h"
+#include "bus-dump.h"
+#include "bus-internal.h"
+#include "bus-message.h"
+#include "bus-type.h"
+
static char *indent(unsigned level, unsigned flags) {
char *p;
unsigned n, i = 0;
diff --git a/src/libsystemd/src/sd-bus/bus-error.c b/src/libsystemd/src/sd-bus/bus-error.c
index 69d14ba9ae..616d784590 100644
--- a/src/libsystemd/src/sd-bus/bus-error.c
+++ b/src/libsystemd/src/sd-bus/bus-error.c
@@ -27,11 +27,12 @@
#include <systemd/sd-bus.h>
#include "basic/alloc-util.h"
-#include "bus-error.h"
#include "basic/errno-list.h"
#include "basic/string-util.h"
#include "basic/util.h"
+#include "bus-error.h"
+
BUS_ERROR_MAP_ELF_REGISTER const sd_bus_error_map bus_standard_errors[] = {
SD_BUS_ERROR_MAP("org.freedesktop.DBus.Error.Failed", EACCES),
SD_BUS_ERROR_MAP("org.freedesktop.DBus.Error.NoMemory", ENOMEM),
diff --git a/src/libsystemd/src/sd-bus/bus-internal.c b/src/libsystemd/src/sd-bus/bus-internal.c
index 0dc1db607e..8dc441227a 100644
--- a/src/libsystemd/src/sd-bus/bus-internal.c
+++ b/src/libsystemd/src/sd-bus/bus-internal.c
@@ -18,11 +18,12 @@
***/
#include "basic/alloc-util.h"
-#include "bus-internal.h"
-#include "bus-message.h"
#include "basic/hexdecoct.h"
#include "basic/string-util.h"
+#include "bus-internal.h"
+#include "bus-message.h"
+
bool object_path_is_valid(const char *p) {
const char *q;
bool slash;
diff --git a/src/libsystemd/src/sd-bus/bus-internal.h b/src/libsystemd/src/sd-bus/bus-internal.h
index 7cf0925876..e02df7981d 100644
--- a/src/libsystemd/src/sd-bus/bus-internal.h
+++ b/src/libsystemd/src/sd-bus/bus-internal.h
@@ -24,17 +24,18 @@
#include <systemd/sd-bus.h>
-#include "bus-error.h"
-#include "bus-kernel.h"
-#include "bus-match.h"
#include "basic/hashmap.h"
-#include "kdbus.h"
#include "basic/list.h"
#include "basic/prioq.h"
#include "basic/refcnt.h"
#include "basic/socket-util.h"
#include "basic/util.h"
+#include "bus-error.h"
+#include "bus-kernel.h"
+#include "bus-match.h"
+#include "kdbus.h"
+
struct reply_callback {
sd_bus_message_handler_t callback;
usec_t timeout;
diff --git a/src/libsystemd/src/sd-bus/bus-introspect.c b/src/libsystemd/src/sd-bus/bus-introspect.c
index 63499d8a19..835b5e3909 100644
--- a/src/libsystemd/src/sd-bus/bus-introspect.c
+++ b/src/libsystemd/src/sd-bus/bus-introspect.c
@@ -17,15 +17,16 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "bus-internal.h"
-#include "bus-introspect.h"
-#include "bus-protocol.h"
-#include "bus-signature.h"
#include "basic/fd-util.h"
#include "basic/fileio.h"
#include "basic/string-util.h"
#include "basic/util.h"
+#include "bus-internal.h"
+#include "bus-introspect.h"
+#include "bus-protocol.h"
+#include "bus-signature.h"
+
int introspect_begin(struct introspect *i, bool trusted) {
assert(i);
diff --git a/src/libsystemd/src/sd-bus/bus-match.c b/src/libsystemd/src/sd-bus/bus-match.c
index be5a0975e3..0dc5e45288 100644
--- a/src/libsystemd/src/sd-bus/bus-match.c
+++ b/src/libsystemd/src/sd-bus/bus-match.c
@@ -18,15 +18,16 @@
***/
#include "basic/alloc-util.h"
-#include "bus-internal.h"
-#include "bus-match.h"
-#include "bus-message.h"
-#include "shared/bus-util.h"
#include "basic/fd-util.h"
#include "basic/fileio.h"
#include "basic/hexdecoct.h"
#include "basic/string-util.h"
#include "basic/strv.h"
+#include "shared/bus-util.h"
+
+#include "bus-internal.h"
+#include "bus-match.h"
+#include "bus-message.h"
/* Example:
*
diff --git a/src/libsystemd/src/sd-bus/bus-message.c b/src/libsystemd/src/sd-bus/bus-message.c
index 96f4213416..a34a4a1619 100644
--- a/src/libsystemd/src/sd-bus/bus-message.c
+++ b/src/libsystemd/src/sd-bus/bus-message.c
@@ -24,12 +24,6 @@
#include <systemd/sd-bus.h>
#include "basic/alloc-util.h"
-#include "bus-gvariant.h"
-#include "bus-internal.h"
-#include "bus-message.h"
-#include "bus-signature.h"
-#include "bus-type.h"
-#include "shared/bus-util.h"
#include "basic/fd-util.h"
#include "basic/io-util.h"
#include "basic/memfd-util.h"
@@ -38,6 +32,13 @@
#include "basic/time-util.h"
#include "basic/utf8.h"
#include "basic/util.h"
+#include "shared/bus-util.h"
+
+#include "bus-gvariant.h"
+#include "bus-internal.h"
+#include "bus-message.h"
+#include "bus-signature.h"
+#include "bus-type.h"
static int message_append_basic(sd_bus_message *m, char type, const void *p, const void **stored);
diff --git a/src/libsystemd/src/sd-bus/bus-message.h b/src/libsystemd/src/sd-bus/bus-message.h
index 6c33343753..35116c3803 100644
--- a/src/libsystemd/src/sd-bus/bus-message.h
+++ b/src/libsystemd/src/sd-bus/bus-message.h
@@ -25,11 +25,12 @@
#include <systemd/sd-bus.h>
-#include "bus-creds.h"
-#include "bus-protocol.h"
#include "basic/macro.h"
#include "basic/time-util.h"
+#include "bus-creds.h"
+#include "bus-protocol.h"
+
struct bus_container {
char enclosing;
bool need_offsets:1;
diff --git a/src/libsystemd/src/sd-bus/bus-objects.c b/src/libsystemd/src/sd-bus/bus-objects.c
index f0e80017c5..a56b7e8d7e 100644
--- a/src/libsystemd/src/sd-bus/bus-objects.c
+++ b/src/libsystemd/src/sd-bus/bus-objects.c
@@ -18,6 +18,11 @@
***/
#include "basic/alloc-util.h"
+#include "basic/set.h"
+#include "basic/string-util.h"
+#include "basic/strv.h"
+#include "shared/bus-util.h"
+
#include "bus-internal.h"
#include "bus-introspect.h"
#include "bus-message.h"
@@ -25,10 +30,6 @@
#include "bus-signature.h"
#include "bus-slot.h"
#include "bus-type.h"
-#include "shared/bus-util.h"
-#include "basic/set.h"
-#include "basic/string-util.h"
-#include "basic/strv.h"
static int node_vtable_get_userdata(
sd_bus *bus,
diff --git a/src/libsystemd/src/sd-bus/bus-slot.c b/src/libsystemd/src/sd-bus/bus-slot.c
index 96fc3f82c4..ebac784433 100644
--- a/src/libsystemd/src/sd-bus/bus-slot.c
+++ b/src/libsystemd/src/sd-bus/bus-slot.c
@@ -20,10 +20,11 @@
#include <systemd/sd-bus.h>
#include "basic/alloc-util.h"
+#include "basic/string-util.h"
+
#include "bus-control.h"
#include "bus-objects.h"
#include "bus-slot.h"
-#include "basic/string-util.h"
sd_bus_slot *bus_slot_allocate(
sd_bus *bus,
diff --git a/src/libsystemd/src/sd-bus/bus-socket.c b/src/libsystemd/src/sd-bus/bus-socket.c
index e05f6d1b04..4d6e21f977 100644
--- a/src/libsystemd/src/sd-bus/bus-socket.c
+++ b/src/libsystemd/src/sd-bus/bus-socket.c
@@ -26,9 +26,6 @@
#include <systemd/sd-daemon.h>
#include "basic/alloc-util.h"
-#include "bus-internal.h"
-#include "bus-message.h"
-#include "bus-socket.h"
#include "basic/fd-util.h"
#include "basic/formats-util.h"
#include "basic/hexdecoct.h"
@@ -42,6 +39,10 @@
#include "basic/utf8.h"
#include "basic/util.h"
+#include "bus-internal.h"
+#include "bus-message.h"
+#include "bus-socket.h"
+
#define SNDBUF_SIZE (8*1024*1024)
static void iovec_advance(struct iovec iov[], unsigned *idx, size_t size) {
diff --git a/src/libsystemd/src/sd-bus/bus-track.c b/src/libsystemd/src/sd-bus/bus-track.c
index 997afd9dc9..24c3a7050d 100644
--- a/src/libsystemd/src/sd-bus/bus-track.c
+++ b/src/libsystemd/src/sd-bus/bus-track.c
@@ -20,9 +20,10 @@
#include <systemd/sd-bus.h>
#include "basic/alloc-util.h"
+#include "shared/bus-util.h"
+
#include "bus-internal.h"
#include "bus-track.h"
-#include "shared/bus-util.h"
struct sd_bus_track {
unsigned n_ref;
diff --git a/src/libsystemd/src/sd-bus/sd-bus.c b/src/libsystemd/src/sd-bus/sd-bus.c
index 748b46413d..83a021e2f5 100644
--- a/src/libsystemd/src/sd-bus/sd-bus.c
+++ b/src/libsystemd/src/sd-bus/sd-bus.c
@@ -28,19 +28,7 @@
#include <systemd/sd-bus.h>
#include "basic/alloc-util.h"
-#include "bus-container.h"
-#include "bus-control.h"
-#include "bus-internal.h"
-#include "bus-kernel.h"
#include "basic/bus-label.h"
-#include "bus-message.h"
-#include "bus-objects.h"
-#include "bus-protocol.h"
-#include "bus-slot.h"
-#include "bus-socket.h"
-#include "bus-track.h"
-#include "bus-type.h"
-#include "shared/bus-util.h"
#include "basic/cgroup-util.h"
#include "basic/def.h"
#include "basic/fd-util.h"
@@ -52,6 +40,19 @@
#include "basic/string-util.h"
#include "basic/strv.h"
#include "basic/util.h"
+#include "shared/bus-util.h"
+
+#include "bus-container.h"
+#include "bus-control.h"
+#include "bus-internal.h"
+#include "bus-kernel.h"
+#include "bus-message.h"
+#include "bus-objects.h"
+#include "bus-protocol.h"
+#include "bus-slot.h"
+#include "bus-socket.h"
+#include "bus-track.h"
+#include "bus-type.h"
#define log_debug_bus_message(m) \
do { \
diff --git a/src/libsystemd/src/sd-bus/test-bus-benchmark.c b/src/libsystemd/src/sd-bus/test-bus-benchmark.c
index 08186870cb..c8f0d11b84 100644
--- a/src/libsystemd/src/sd-bus/test-bus-benchmark.c
+++ b/src/libsystemd/src/sd-bus/test-bus-benchmark.c
@@ -22,13 +22,14 @@
#include <systemd/sd-bus.h>
#include "basic/alloc-util.h"
-#include "bus-internal.h"
-#include "bus-kernel.h"
-#include "shared/bus-util.h"
#include "basic/def.h"
#include "basic/fd-util.h"
#include "basic/time-util.h"
#include "basic/util.h"
+#include "shared/bus-util.h"
+
+#include "bus-internal.h"
+#include "bus-kernel.h"
#define MAX_SIZE (2*1024*1024)
diff --git a/src/libsystemd/src/sd-bus/test-bus-chat.c b/src/libsystemd/src/sd-bus/test-bus-chat.c
index 353edc9c7c..8f3e88a7c0 100644
--- a/src/libsystemd/src/sd-bus/test-bus-chat.c
+++ b/src/libsystemd/src/sd-bus/test-bus-chat.c
@@ -25,15 +25,16 @@
#include <systemd/sd-bus.h>
#include "basic/alloc-util.h"
-#include "bus-error.h"
-#include "bus-internal.h"
-#include "bus-match.h"
-#include "shared/bus-util.h"
#include "basic/fd-util.h"
#include "basic/formats-util.h"
#include "basic/log.h"
#include "basic/macro.h"
#include "basic/util.h"
+#include "shared/bus-util.h"
+
+#include "bus-error.h"
+#include "bus-internal.h"
+#include "bus-match.h"
static int match_callback(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) {
log_info("Match triggered! interface=%s member=%s", strna(sd_bus_message_get_interface(m)), strna(sd_bus_message_get_member(m)));
diff --git a/src/libsystemd/src/sd-bus/test-bus-cleanup.c b/src/libsystemd/src/sd-bus/test-bus-cleanup.c
index 3a308453ed..f4b9f96c03 100644
--- a/src/libsystemd/src/sd-bus/test-bus-cleanup.c
+++ b/src/libsystemd/src/sd-bus/test-bus-cleanup.c
@@ -21,10 +21,11 @@
#include <systemd/sd-bus.h>
+#include "basic/refcnt.h"
+#include "shared/bus-util.h"
+
#include "bus-internal.h"
#include "bus-message.h"
-#include "shared/bus-util.h"
-#include "basic/refcnt.h"
static void test_bus_new(void) {
_cleanup_(sd_bus_unrefp) sd_bus *bus = NULL;
diff --git a/src/libsystemd/src/sd-bus/test-bus-creds.c b/src/libsystemd/src/sd-bus/test-bus-creds.c
index 22fe1fa759..125d7db810 100644
--- a/src/libsystemd/src/sd-bus/test-bus-creds.c
+++ b/src/libsystemd/src/sd-bus/test-bus-creds.c
@@ -19,9 +19,10 @@
#include <systemd/sd-bus.h>
-#include "bus-dump.h"
-#include "shared/bus-util.h"
#include "basic/cgroup-util.h"
+#include "shared/bus-util.h"
+
+#include "bus-dump.h"
int main(int argc, char *argv[]) {
_cleanup_(sd_bus_creds_unrefp) sd_bus_creds *creds = NULL;
diff --git a/src/libsystemd/src/sd-bus/test-bus-error.c b/src/libsystemd/src/sd-bus/test-bus-error.c
index 348629c718..2d0aa92c6c 100644
--- a/src/libsystemd/src/sd-bus/test-bus-error.c
+++ b/src/libsystemd/src/sd-bus/test-bus-error.c
@@ -19,10 +19,11 @@
#include <systemd/sd-bus.h>
+#include "basic/errno-list.h"
+#include "shared/bus-util.h"
+
#include "bus-common-errors.h"
#include "bus-error.h"
-#include "shared/bus-util.h"
-#include "basic/errno-list.h"
static void test_error(void) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL, second = SD_BUS_ERROR_NULL;
diff --git a/src/libsystemd/src/sd-bus/test-bus-introspect.c b/src/libsystemd/src/sd-bus/test-bus-introspect.c
index b7b2b79f95..517e3668ae 100644
--- a/src/libsystemd/src/sd-bus/test-bus-introspect.c
+++ b/src/libsystemd/src/sd-bus/test-bus-introspect.c
@@ -17,9 +17,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "bus-introspect.h"
#include "basic/log.h"
+#include "bus-introspect.h"
+
static int prop_get(sd_bus *bus, const char *path, const char *interface, const char *property, sd_bus_message *reply, void *userdata, sd_bus_error *error) {
return -EINVAL;
}
diff --git a/src/libsystemd/src/sd-bus/test-bus-kernel-bloom.c b/src/libsystemd/src/sd-bus/test-bus-kernel-bloom.c
index 75874a6892..cb8c41b792 100644
--- a/src/libsystemd/src/sd-bus/test-bus-kernel-bloom.c
+++ b/src/libsystemd/src/sd-bus/test-bus-kernel-bloom.c
@@ -20,11 +20,12 @@
#include <systemd/sd-bus.h>
#include "basic/alloc-util.h"
-#include "bus-kernel.h"
-#include "shared/bus-util.h"
#include "basic/fd-util.h"
#include "basic/log.h"
#include "basic/util.h"
+#include "shared/bus-util.h"
+
+#include "bus-kernel.h"
static int test_match(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) {
int *found = userdata;
diff --git a/src/libsystemd/src/sd-bus/test-bus-kernel.c b/src/libsystemd/src/sd-bus/test-bus-kernel.c
index 79ac9064d6..871bf2e62c 100644
--- a/src/libsystemd/src/sd-bus/test-bus-kernel.c
+++ b/src/libsystemd/src/sd-bus/test-bus-kernel.c
@@ -22,12 +22,13 @@
#include <systemd/sd-bus.h>
#include "basic/alloc-util.h"
-#include "bus-dump.h"
-#include "bus-kernel.h"
-#include "shared/bus-util.h"
#include "basic/fd-util.h"
#include "basic/log.h"
#include "basic/util.h"
+#include "shared/bus-util.h"
+
+#include "bus-dump.h"
+#include "bus-kernel.h"
int main(int argc, char *argv[]) {
_cleanup_close_ int bus_ref = -1;
diff --git a/src/libsystemd/src/sd-bus/test-bus-match.c b/src/libsystemd/src/sd-bus/test-bus-match.c
index c73643ec37..e50cebcdc6 100644
--- a/src/libsystemd/src/sd-bus/test-bus-match.c
+++ b/src/libsystemd/src/sd-bus/test-bus-match.c
@@ -17,12 +17,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include "basic/log.h"
+#include "basic/macro.h"
+#include "shared/bus-util.h"
+
#include "bus-match.h"
#include "bus-message.h"
#include "bus-slot.h"
-#include "shared/bus-util.h"
-#include "basic/log.h"
-#include "basic/macro.h"
static bool mask[32];
diff --git a/src/libsystemd/src/sd-bus/test-bus-objects.c b/src/libsystemd/src/sd-bus/test-bus-objects.c
index 990dd196e2..1c6e28e76e 100644
--- a/src/libsystemd/src/sd-bus/test-bus-objects.c
+++ b/src/libsystemd/src/sd-bus/test-bus-objects.c
@@ -23,14 +23,15 @@
#include <systemd/sd-bus.h>
#include "basic/alloc-util.h"
-#include "bus-dump.h"
-#include "bus-internal.h"
-#include "bus-message.h"
-#include "shared/bus-util.h"
#include "basic/log.h"
#include "basic/macro.h"
#include "basic/strv.h"
#include "basic/util.h"
+#include "shared/bus-util.h"
+
+#include "bus-dump.h"
+#include "bus-internal.h"
+#include "bus-message.h"
struct context {
int fds[2];
diff --git a/src/libsystemd/src/sd-bus/test-bus-server.c b/src/libsystemd/src/sd-bus/test-bus-server.c
index 596529b7e4..9ffefa6cd0 100644
--- a/src/libsystemd/src/sd-bus/test-bus-server.c
+++ b/src/libsystemd/src/sd-bus/test-bus-server.c
@@ -22,11 +22,12 @@
#include <systemd/sd-bus.h>
-#include "bus-internal.h"
-#include "shared/bus-util.h"
#include "basic/log.h"
#include "basic/macro.h"
#include "basic/util.h"
+#include "shared/bus-util.h"
+
+#include "bus-internal.h"
struct context {
int fds[2];
diff --git a/src/libsystemd/src/sd-bus/test-bus-signature.c b/src/libsystemd/src/sd-bus/test-bus-signature.c
index b2651a1824..c08999b8e1 100644
--- a/src/libsystemd/src/sd-bus/test-bus-signature.c
+++ b/src/libsystemd/src/sd-bus/test-bus-signature.c
@@ -17,11 +17,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "bus-internal.h"
-#include "bus-signature.h"
#include "basic/log.h"
#include "basic/string-util.h"
+#include "bus-internal.h"
+#include "bus-signature.h"
+
int main(int argc, char *argv[]) {
char prefix[256];
int r;
diff --git a/src/libsystemd/src/sd-bus/test-bus-zero-copy.c b/src/libsystemd/src/sd-bus/test-bus-zero-copy.c
index e43ce8bc33..ac453e5887 100644
--- a/src/libsystemd/src/sd-bus/test-bus-zero-copy.c
+++ b/src/libsystemd/src/sd-bus/test-bus-zero-copy.c
@@ -22,15 +22,16 @@
#include <systemd/sd-bus.h>
#include "basic/alloc-util.h"
-#include "bus-dump.h"
-#include "bus-kernel.h"
-#include "bus-message.h"
#include "basic/fd-util.h"
#include "basic/log.h"
#include "basic/memfd-util.h"
#include "basic/string-util.h"
#include "basic/util.h"
+#include "bus-dump.h"
+#include "bus-kernel.h"
+#include "bus-message.h"
+
#define FIRST_ARRAY 17
#define SECOND_ARRAY 33
diff --git a/src/libsystemd/src/sd-device/device-enumerator.c b/src/libsystemd/src/sd-device/device-enumerator.c
index 97f3453898..6378f9c93c 100644
--- a/src/libsystemd/src/sd-device/device-enumerator.c
+++ b/src/libsystemd/src/sd-device/device-enumerator.c
@@ -18,11 +18,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "sd-device.h"
-
#include "basic/alloc-util.h"
-#include "device-enumerator-private.h"
-#include "device-util.h"
#include "basic/dirent-util.h"
#include "basic/fd-util.h"
#include "basic/prioq.h"
@@ -31,6 +27,10 @@
#include "basic/strv.h"
#include "basic/util.h"
+#include "device-enumerator-private.h"
+#include "device-util.h"
+#include "sd-device.h"
+
#define DEVICE_ENUMERATE_MAX_DEPTH 256
typedef enum DeviceEnumerationType {
diff --git a/src/libsystemd/src/sd-device/device-private.c b/src/libsystemd/src/sd-device/device-private.c
index dce2ba091a..bf028fbbc6 100644
--- a/src/libsystemd/src/sd-device/device-private.c
+++ b/src/libsystemd/src/sd-device/device-private.c
@@ -22,12 +22,7 @@
#include <net/if.h>
#include <sys/types.h>
-#include "sd-device.h"
-
#include "basic/alloc-util.h"
-#include "device-internal.h"
-#include "device-private.h"
-#include "device-util.h"
#include "basic/fd-util.h"
#include "basic/fileio.h"
#include "basic/fs-util.h"
@@ -45,6 +40,11 @@
#include "basic/user-util.h"
#include "basic/util.h"
+#include "device-internal.h"
+#include "device-private.h"
+#include "device-util.h"
+#include "sd-device.h"
+
int device_add_property(sd_device *device, const char *key, const char *value) {
int r;
diff --git a/src/libsystemd/src/sd-device/sd-device.c b/src/libsystemd/src/sd-device/sd-device.c
index 20c7684b97..b8e6f8580e 100644
--- a/src/libsystemd/src/sd-device/sd-device.c
+++ b/src/libsystemd/src/sd-device/sd-device.c
@@ -22,12 +22,7 @@
#include <net/if.h>
#include <sys/types.h>
-#include "sd-device.h"
-
#include "basic/alloc-util.h"
-#include "device-internal.h"
-#include "device-private.h"
-#include "device-util.h"
#include "basic/fd-util.h"
#include "basic/fileio.h"
#include "basic/fs-util.h"
@@ -42,6 +37,11 @@
#include "basic/strxcpyx.h"
#include "basic/util.h"
+#include "device-internal.h"
+#include "device-private.h"
+#include "device-util.h"
+#include "sd-device.h"
+
int device_new_aux(sd_device **ret) {
_cleanup_(sd_device_unrefp) sd_device *device = NULL;
diff --git a/src/libsystemd/src/sd-hwdb/hwdb-util.h b/src/libsystemd/src/sd-hwdb/hwdb-util.h
index 63c154d34e..c8c0a4938e 100644
--- a/src/libsystemd/src/sd-hwdb/hwdb-util.h
+++ b/src/libsystemd/src/sd-hwdb/hwdb-util.h
@@ -19,8 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "sd-hwdb.h"
-
#include "basic/util.h"
+#include "sd-hwdb.h"
+
bool hwdb_validate(sd_hwdb *hwdb);
diff --git a/src/libsystemd/src/sd-hwdb/sd-hwdb.c b/src/libsystemd/src/sd-hwdb/sd-hwdb.c
index 9964599c99..a48c7af124 100644
--- a/src/libsystemd/src/sd-hwdb/sd-hwdb.c
+++ b/src/libsystemd/src/sd-hwdb/sd-hwdb.c
@@ -27,16 +27,16 @@
#include <string.h>
#include <sys/mman.h>
-#include "sd-hwdb.h"
-
#include "basic/alloc-util.h"
#include "basic/fd-util.h"
#include "basic/hashmap.h"
-#include "hwdb-internal.h"
-#include "hwdb-util.h"
#include "basic/refcnt.h"
#include "basic/string-util.h"
+#include "hwdb-internal.h"
+#include "hwdb-util.h"
+#include "sd-hwdb.h"
+
struct sd_hwdb {
RefCount n_ref;
int refcount;
diff --git a/src/libsystemd/src/sd-journal/audit-type.c b/src/libsystemd/src/sd-journal/audit-type.c
index 330e0b5d9d..d335e0495d 100644
--- a/src/libsystemd/src/sd-journal/audit-type.c
+++ b/src/libsystemd/src/sd-journal/audit-type.c
@@ -17,8 +17,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdio.h>
#include <linux/audit.h>
+#include <stdio.h>
#ifdef HAVE_AUDIT
# include <libaudit.h>
#endif
diff --git a/src/libsystemd/src/sd-journal/catalog.c b/src/libsystemd/src/sd-journal/catalog.c
index 173f320f40..7dc02deb49 100644
--- a/src/libsystemd/src/sd-journal/catalog.c
+++ b/src/libsystemd/src/sd-journal/catalog.c
@@ -28,7 +28,6 @@
#include <systemd/sd-id128.h>
#include "basic/alloc-util.h"
-#include "catalog.h"
#include "basic/conf-files.h"
#include "basic/fd-util.h"
#include "basic/fileio.h"
@@ -43,6 +42,8 @@
#include "basic/strv.h"
#include "basic/util.h"
+#include "catalog.h"
+
const char * const catalog_file_dirs[] = {
"/usr/local/lib/systemd/catalog/",
"/usr/lib/systemd/catalog/",
diff --git a/src/libsystemd/src/sd-journal/journal-authenticate.c b/src/libsystemd/src/sd-journal/journal-authenticate.c
index ecdbdb08b5..5400d38ffd 100644
--- a/src/libsystemd/src/sd-journal/journal-authenticate.c
+++ b/src/libsystemd/src/sd-journal/journal-authenticate.c
@@ -21,9 +21,10 @@
#include <sys/mman.h>
#include "basic/fd-util.h"
+#include "basic/hexdecoct.h"
+
#include "fsprg.h"
#include "gcrypt-util.h"
-#include "basic/hexdecoct.h"
#include "journal-authenticate.h"
#include "journal-def.h"
#include "journal-file.h"
diff --git a/src/libsystemd/src/sd-journal/journal-file.c b/src/libsystemd/src/sd-journal/journal-file.c
index f626ea0ee9..af8a4e436f 100644
--- a/src/libsystemd/src/sd-journal/journal-file.c
+++ b/src/libsystemd/src/sd-journal/journal-file.c
@@ -27,23 +27,25 @@
#include <sys/uio.h>
#include <unistd.h>
+#include <systemd/sd-event.h>
+
#include "basic/alloc-util.h"
#include "basic/btrfs-util.h"
#include "basic/chattr-util.h"
-#include "compress.h"
#include "basic/fd-util.h"
-#include "journal-authenticate.h"
-#include "journal-def.h"
-#include "journal-file.h"
-#include "lookup3.h"
#include "basic/parse-util.h"
#include "basic/path-util.h"
#include "basic/random-util.h"
-#include <systemd/sd-event.h>
#include "basic/set.h"
#include "basic/string-util.h"
#include "basic/xattr-util.h"
+#include "compress.h"
+#include "journal-authenticate.h"
+#include "journal-def.h"
+#include "journal-file.h"
+#include "lookup3.h"
+
#define DEFAULT_DATA_HASH_TABLE_SIZE (2047ULL*sizeof(HashItem))
#define DEFAULT_FIELD_HASH_TABLE_SIZE (333ULL*sizeof(HashItem))
diff --git a/src/libsystemd/src/sd-journal/journal-internal.h b/src/libsystemd/src/sd-journal/journal-internal.h
index ff6bf6f2b4..e249a8b979 100644
--- a/src/libsystemd/src/sd-journal/journal-internal.h
+++ b/src/libsystemd/src/sd-journal/journal-internal.h
@@ -27,11 +27,12 @@
#include <systemd/sd-journal.h>
#include "basic/hashmap.h"
-#include "journal-def.h"
-#include "journal-file.h"
#include "basic/list.h"
#include "basic/set.h"
+#include "journal-def.h"
+#include "journal-file.h"
+
typedef struct Match Match;
typedef struct Location Location;
typedef struct Directory Directory;
diff --git a/src/libsystemd/src/sd-journal/journal-vacuum.c b/src/libsystemd/src/sd-journal/journal-vacuum.c
index 3ce00bec7d..a3ebf9b029 100644
--- a/src/libsystemd/src/sd-journal/journal-vacuum.c
+++ b/src/libsystemd/src/sd-journal/journal-vacuum.c
@@ -26,14 +26,15 @@
#include "basic/alloc-util.h"
#include "basic/dirent-util.h"
#include "basic/fd-util.h"
-#include "journal-def.h"
-#include "journal-file.h"
-#include "journal-vacuum.h"
#include "basic/parse-util.h"
#include "basic/string-util.h"
#include "basic/util.h"
#include "basic/xattr-util.h"
+#include "journal-def.h"
+#include "journal-file.h"
+#include "journal-vacuum.h"
+
struct vacuum_info {
uint64_t usage;
char *filename;
diff --git a/src/libsystemd/src/sd-journal/journal-verify.c b/src/libsystemd/src/sd-journal/journal-verify.c
index 3fcae64f92..f82bdf8518 100644
--- a/src/libsystemd/src/sd-journal/journal-verify.c
+++ b/src/libsystemd/src/sd-journal/journal-verify.c
@@ -23,17 +23,18 @@
#include <unistd.h>
#include "basic/alloc-util.h"
-#include "compress.h"
#include "basic/fd-util.h"
#include "basic/fileio.h"
+#include "basic/macro.h"
+#include "basic/terminal-util.h"
+#include "basic/util.h"
+
+#include "compress.h"
#include "journal-authenticate.h"
#include "journal-def.h"
#include "journal-file.h"
#include "journal-verify.h"
#include "lookup3.h"
-#include "basic/macro.h"
-#include "basic/terminal-util.h"
-#include "basic/util.h"
static void draw_progress(uint64_t p, usec_t *last_usec) {
unsigned n, i, j, k;
diff --git a/src/libsystemd/src/sd-journal/mmap-cache.c b/src/libsystemd/src/sd-journal/mmap-cache.c
index e488755e67..7f4aa78308 100644
--- a/src/libsystemd/src/sd-journal/mmap-cache.c
+++ b/src/libsystemd/src/sd-journal/mmap-cache.c
@@ -27,10 +27,11 @@
#include "basic/list.h"
#include "basic/log.h"
#include "basic/macro.h"
-#include "mmap-cache.h"
#include "basic/sigbus.h"
#include "basic/util.h"
+#include "mmap-cache.h"
+
typedef struct Window Window;
typedef struct Context Context;
typedef struct FileDescriptor FileDescriptor;
diff --git a/src/libsystemd/src/sd-journal/sd-journal.c b/src/libsystemd/src/sd-journal/sd-journal.c
index aada73f8ec..ce03f24d4d 100644
--- a/src/libsystemd/src/sd-journal/sd-journal.c
+++ b/src/libsystemd/src/sd-journal/sd-journal.c
@@ -30,8 +30,6 @@
#include <systemd/sd-journal.h>
#include "basic/alloc-util.h"
-#include "catalog.h"
-#include "compress.h"
#include "basic/dirent-util.h"
#include "basic/fd-util.h"
#include "basic/fileio.h"
@@ -40,11 +38,7 @@
#include "basic/hashmap.h"
#include "basic/hostname-util.h"
#include "basic/io-util.h"
-#include "journal-def.h"
-#include "journal-file.h"
-#include "journal-internal.h"
#include "basic/list.h"
-#include "lookup3.h"
#include "basic/missing.h"
#include "basic/path-util.h"
#include "basic/replace-var.h"
@@ -53,6 +47,13 @@
#include "basic/string-util.h"
#include "basic/strv.h"
+#include "catalog.h"
+#include "compress.h"
+#include "journal-def.h"
+#include "journal-file.h"
+#include "journal-internal.h"
+#include "lookup3.h"
+
#define JOURNAL_FILES_MAX 7168
#define JOURNAL_FILES_RECHECK_USEC (2 * USEC_PER_SEC)
diff --git a/src/libsystemd/src/sd-netlink/local-addresses.c b/src/libsystemd/src/sd-netlink/local-addresses.c
index f2382847dd..0baaab557f 100644
--- a/src/libsystemd/src/sd-netlink/local-addresses.c
+++ b/src/libsystemd/src/sd-netlink/local-addresses.c
@@ -18,12 +18,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "sd-netlink.h"
-
#include "basic/alloc-util.h"
-#include "local-addresses.h"
#include "basic/macro.h"
+#include "local-addresses.h"
+#include "sd-netlink.h"
+
static int address_compare(const void *_a, const void *_b) {
const struct local_address *a = _a, *b = _b;
diff --git a/src/libsystemd/src/sd-netlink/local-addresses.h b/src/libsystemd/src/sd-netlink/local-addresses.h
index 498797f515..5eb0683131 100644
--- a/src/libsystemd/src/sd-netlink/local-addresses.h
+++ b/src/libsystemd/src/sd-netlink/local-addresses.h
@@ -20,10 +20,10 @@
***/
-#include "sd-netlink.h"
-
#include "basic/in-addr-util.h"
+#include "sd-netlink.h"
+
struct local_address {
int family, ifindex;
unsigned char scope;
diff --git a/src/libsystemd/src/sd-netlink/netlink-internal.h b/src/libsystemd/src/sd-netlink/netlink-internal.h
index d989789fe5..69511f87ad 100644
--- a/src/libsystemd/src/sd-netlink/netlink-internal.h
+++ b/src/libsystemd/src/sd-netlink/netlink-internal.h
@@ -21,13 +21,13 @@
#include <linux/netlink.h>
-#include "sd-netlink.h"
-
#include "basic/list.h"
-#include "netlink-types.h"
#include "basic/prioq.h"
#include "basic/refcnt.h"
+#include "netlink-types.h"
+#include "sd-netlink.h"
+
#define RTNL_DEFAULT_TIMEOUT ((usec_t) (25 * USEC_PER_SEC))
#define RTNL_WQUEUE_MAX 1024
diff --git a/src/libsystemd/src/sd-netlink/netlink-message.c b/src/libsystemd/src/sd-netlink/netlink-message.c
index c885b97117..fd32776a19 100644
--- a/src/libsystemd/src/sd-netlink/netlink-message.c
+++ b/src/libsystemd/src/sd-netlink/netlink-message.c
@@ -21,18 +21,18 @@
#include <stdbool.h>
#include <unistd.h>
-#include "sd-netlink.h"
-
#include "basic/alloc-util.h"
#include "basic/formats-util.h"
#include "basic/missing.h"
-#include "netlink-internal.h"
-#include "netlink-types.h"
-#include "netlink-util.h"
#include "basic/refcnt.h"
#include "basic/socket-util.h"
#include "basic/util.h"
+#include "netlink-internal.h"
+#include "netlink-types.h"
+#include "netlink-util.h"
+#include "sd-netlink.h"
+
#define GET_CONTAINER(m, i) ((i) < (m)->n_containers ? (struct rtattr*)((uint8_t*)(m)->hdr + (m)->containers[i].offset) : NULL)
#define PUSH_CONTAINER(m, new) (m)->container_offsets[(m)->n_containers++] = (uint8_t*)(new) - (uint8_t*)(m)->hdr;
diff --git a/src/libsystemd/src/sd-netlink/netlink-socket.c b/src/libsystemd/src/sd-netlink/netlink-socket.c
index 8e0e5d2b04..ec3513bcf8 100644
--- a/src/libsystemd/src/sd-netlink/netlink-socket.c
+++ b/src/libsystemd/src/sd-netlink/netlink-socket.c
@@ -21,18 +21,18 @@
#include <stdbool.h>
#include <unistd.h>
-#include "sd-netlink.h"
-
#include "basic/alloc-util.h"
#include "basic/formats-util.h"
#include "basic/missing.h"
-#include "netlink-internal.h"
-#include "netlink-types.h"
-#include "netlink-util.h"
#include "basic/refcnt.h"
#include "basic/socket-util.h"
#include "basic/util.h"
+#include "netlink-internal.h"
+#include "netlink-types.h"
+#include "netlink-util.h"
+#include "sd-netlink.h"
+
int socket_open(int family) {
int fd;
diff --git a/src/libsystemd/src/sd-netlink/netlink-types.c b/src/libsystemd/src/sd-netlink/netlink-types.c
index 9f7ddf08d8..3b013507bd 100644
--- a/src/libsystemd/src/sd-netlink/netlink-types.c
+++ b/src/libsystemd/src/sd-netlink/netlink-types.c
@@ -17,25 +17,26 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdint.h>
-#include <sys/socket.h>
-#include <linux/netlink.h>
-#include <linux/rtnetlink.h>
-#include <linux/in6.h>
-#include <linux/veth.h>
-#include <linux/if_bridge.h>
-#include <linux/if_addr.h>
#include <linux/if.h>
-#include <linux/ip.h>
+#include <linux/if_addr.h>
+#include <linux/if_bridge.h>
#include <linux/if_link.h>
#include <linux/if_tunnel.h>
+#include <linux/in6.h>
+#include <linux/ip.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
+#include <linux/veth.h>
+#include <stdint.h>
+#include <sys/socket.h>
#include "basic/macro.h"
#include "basic/missing.h"
-#include "netlink-types.h"
#include "basic/string-table.h"
#include "basic/util.h"
+#include "netlink-types.h"
+
/* Maximum ARP IP target defined in kernel */
#define BOND_MAX_ARP_TARGETS 16
diff --git a/src/libsystemd/src/sd-netlink/netlink-util.c b/src/libsystemd/src/sd-netlink/netlink-util.c
index 73b9ac0258..9248aa0b18 100644
--- a/src/libsystemd/src/sd-netlink/netlink-util.c
+++ b/src/libsystemd/src/sd-netlink/netlink-util.c
@@ -17,10 +17,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "sd-netlink.h"
-
#include "netlink-internal.h"
#include "netlink-util.h"
+#include "sd-netlink.h"
int rtnl_set_link_name(sd_netlink **rtnl, int ifindex, const char *name) {
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *message = NULL;
diff --git a/src/libsystemd/src/sd-netlink/netlink-util.h b/src/libsystemd/src/sd-netlink/netlink-util.h
index ddd25e36be..c9b932f994 100644
--- a/src/libsystemd/src/sd-netlink/netlink-util.h
+++ b/src/libsystemd/src/sd-netlink/netlink-util.h
@@ -19,10 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "sd-netlink.h"
-
#include "basic/util.h"
+#include "sd-netlink.h"
+
int rtnl_message_new_synthetic_error(int error, uint32_t serial, sd_netlink_message **ret);
uint32_t rtnl_message_get_serial(sd_netlink_message *m);
void rtnl_message_seal(sd_netlink_message *m);
diff --git a/src/libsystemd/src/sd-netlink/rtnl-message.c b/src/libsystemd/src/sd-netlink/rtnl-message.c
index 0c1b7b3218..42178e5706 100644
--- a/src/libsystemd/src/sd-netlink/rtnl-message.c
+++ b/src/libsystemd/src/sd-netlink/rtnl-message.c
@@ -21,17 +21,17 @@
#include <stdbool.h>
#include <unistd.h>
-#include "sd-netlink.h"
-
#include "basic/formats-util.h"
#include "basic/missing.h"
-#include "netlink-internal.h"
-#include "netlink-types.h"
-#include "netlink-util.h"
#include "basic/refcnt.h"
#include "basic/socket-util.h"
#include "basic/util.h"
+#include "netlink-internal.h"
+#include "netlink-types.h"
+#include "netlink-util.h"
+#include "sd-netlink.h"
+
int sd_rtnl_message_route_set_dst_prefixlen(sd_netlink_message *m, unsigned char prefixlen) {
struct rtmsg *rtm;
diff --git a/src/libsystemd/src/sd-netlink/sd-netlink.c b/src/libsystemd/src/sd-netlink/sd-netlink.c
index 2314dfabe8..1329c56bbd 100644
--- a/src/libsystemd/src/sd-netlink/sd-netlink.c
+++ b/src/libsystemd/src/sd-netlink/sd-netlink.c
@@ -20,18 +20,18 @@
#include <poll.h>
#include <sys/socket.h>
-#include "sd-netlink.h"
-
#include "basic/alloc-util.h"
#include "basic/fd-util.h"
#include "basic/hashmap.h"
#include "basic/macro.h"
#include "basic/missing.h"
-#include "netlink-internal.h"
-#include "netlink-util.h"
#include "basic/socket-util.h"
#include "basic/util.h"
+#include "netlink-internal.h"
+#include "netlink-util.h"
+#include "sd-netlink.h"
+
static int sd_netlink_new(sd_netlink **ret) {
_cleanup_(sd_netlink_unrefp) sd_netlink *rtnl = NULL;
diff --git a/src/libsystemd/src/sd-netlink/sd-netlink.h b/src/libsystemd/src/sd-netlink/sd-netlink.h
index 1faca07ce8..5d30127f8f 100644
--- a/src/libsystemd/src/sd-netlink/sd-netlink.h
+++ b/src/libsystemd/src/sd-netlink/sd-netlink.h
@@ -21,14 +21,13 @@
***/
#include <inttypes.h>
+#include <linux/neighbour.h>
+#include <linux/rtnetlink.h>
#include <netinet/ether.h>
#include <netinet/in.h>
-#include <linux/rtnetlink.h>
-#include <linux/neighbour.h>
-
-#include <systemd/sd-event.h>
#include <systemd/_sd-common.h>
+#include <systemd/sd-event.h>
_SD_BEGIN_DECLARATIONS;
diff --git a/src/libsystemd/src/sd-netlink/test-local-addresses.c b/src/libsystemd/src/sd-netlink/test-local-addresses.c
index 7582a331c8..8755a27182 100644
--- a/src/libsystemd/src/sd-netlink/test-local-addresses.c
+++ b/src/libsystemd/src/sd-netlink/test-local-addresses.c
@@ -20,6 +20,7 @@
#include "basic/af-list.h"
#include "basic/alloc-util.h"
#include "basic/in-addr-util.h"
+
#include "local-addresses.h"
static void print_local_addresses(struct local_address *a, unsigned n) {
diff --git a/src/libsystemd/src/sd-netlink/test-netlink.c b/src/libsystemd/src/sd-netlink/test-netlink.c
index 90513fa5a2..1fde81778e 100644
--- a/src/libsystemd/src/sd-netlink/test-netlink.c
+++ b/src/libsystemd/src/sd-netlink/test-netlink.c
@@ -20,16 +20,16 @@
#include <net/if.h>
#include <netinet/ether.h>
-#include "sd-netlink.h"
-
#include "basic/ether-addr-util.h"
#include "basic/macro.h"
#include "basic/missing.h"
-#include "netlink-util.h"
#include "basic/socket-util.h"
#include "basic/string-util.h"
#include "basic/util.h"
+#include "netlink-util.h"
+#include "sd-netlink.h"
+
static void test_message_link_bridge(sd_netlink *rtnl) {
_cleanup_(sd_netlink_message_unrefp) sd_netlink_message *message = NULL;
uint32_t cost;
diff --git a/src/libsystemd/src/sd-network/network-util.c b/src/libsystemd/src/sd-network/network-util.c
index ac488a0bf2..ae3e51ae77 100644
--- a/src/libsystemd/src/sd-network/network-util.c
+++ b/src/libsystemd/src/sd-network/network-util.c
@@ -19,9 +19,10 @@
#include "basic/alloc-util.h"
#include "basic/fd-util.h"
-#include "network-util.h"
#include "basic/strv.h"
+#include "network-util.h"
+
bool network_is_online(void) {
_cleanup_free_ char *state = NULL;
int r;
diff --git a/src/libsystemd/src/sd-network/sd-network.c b/src/libsystemd/src/sd-network/sd-network.c
index e97a68f566..c3755371ff 100644
--- a/src/libsystemd/src/sd-network/sd-network.c
+++ b/src/libsystemd/src/sd-network/sd-network.c
@@ -23,8 +23,6 @@
#include <string.h>
#include <sys/inotify.h>
-#include "sd-network.h"
-
#include "basic/alloc-util.h"
#include "basic/fd-util.h"
#include "basic/fileio.h"
@@ -36,6 +34,8 @@
#include "basic/strv.h"
#include "basic/util.h"
+#include "sd-network.h"
+
_public_ int sd_network_get_operational_state(char **state) {
_cleanup_free_ char *s = NULL;
int r;
diff --git a/src/libsystemd/src/sd-resolve/sd-resolve.c b/src/libsystemd/src/sd-resolve/sd-resolve.c
index 001f527c68..d10204cde9 100644
--- a/src/libsystemd/src/sd-resolve/sd-resolve.c
+++ b/src/libsystemd/src/sd-resolve/sd-resolve.c
@@ -29,8 +29,6 @@
#include <sys/prctl.h>
#include <unistd.h>
-#include "sd-resolve.h"
-
#include "basic/alloc-util.h"
#include "basic/fd-util.h"
#include "basic/io-util.h"
@@ -39,6 +37,8 @@
#include "basic/socket-util.h"
#include "basic/util.h"
+#include "sd-resolve.h"
+
#define WORKERS_MIN 1U
#define WORKERS_MAX 16U
#define QUERIES_MAX 256U
diff --git a/src/libsystemd/src/sd-resolve/sd-resolve.h b/src/libsystemd/src/sd-resolve/sd-resolve.h
index 2e718ec543..1996ae401a 100644
--- a/src/libsystemd/src/sd-resolve/sd-resolve.h
+++ b/src/libsystemd/src/sd-resolve/sd-resolve.h
@@ -25,9 +25,8 @@
#include <sys/socket.h>
#include <sys/types.h>
-#include <systemd/sd-event.h>
-
#include <systemd/_sd-common.h>
+#include <systemd/sd-event.h>
_SD_BEGIN_DECLARATIONS;
diff --git a/src/libsystemd/src/sd-resolve/test-resolve.c b/src/libsystemd/src/sd-resolve/test-resolve.c
index 59dd0d540f..d552a48da8 100644
--- a/src/libsystemd/src/sd-resolve/test-resolve.c
+++ b/src/libsystemd/src/sd-resolve/test-resolve.c
@@ -26,13 +26,13 @@
#include <string.h>
#include <sys/socket.h>
-#include "sd-resolve.h"
-
#include "basic/alloc-util.h"
#include "basic/macro.h"
#include "basic/socket-util.h"
#include "basic/string-util.h"
+#include "sd-resolve.h"
+
static int getaddrinfo_handler(sd_resolve_query *q, int ret, const struct addrinfo *ai, void *userdata) {
const struct addrinfo *i;