]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
timesync: Clean up includes 37527/head
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 21 May 2025 07:42:03 +0000 (09:42 +0200)
committerDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 21 May 2025 08:49:43 +0000 (10:49 +0200)
Split out of #37344.

12 files changed:
src/timesync/test-timesync.c
src/timesync/timesyncd-bus.c
src/timesync/timesyncd-bus.h
src/timesync/timesyncd-conf.c
src/timesync/timesyncd-conf.h
src/timesync/timesyncd-forward.h [new file with mode: 0644]
src/timesync/timesyncd-manager.c
src/timesync/timesyncd-manager.h
src/timesync/timesyncd-ntp-message.h
src/timesync/timesyncd-server.h
src/timesync/timesyncd.c
src/timesync/wait-sync.c

index c8d8fd4bd4ab36f77645946b73b8f82e8c104b4a..7cbdd4060d967dfd585990090eca3db212abb007 100644 (file)
@@ -2,8 +2,6 @@
 
 /* Some unit tests for the helper functions in timesyncd. */
 
-#include "log.h"
-#include "macro.h"
 #include "tests.h"
 #include "timesyncd-conf.h"
 #include "timesyncd-manager.h"
index 2c780f1d17ed3aba15246a6598c359a1f845db6f..b060431f6ca727f2abe5f6561859eac4c50daa63 100644 (file)
@@ -1,26 +1,20 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <sys/capability.h>
-
 #include "sd-bus.h"
 
-#include "alloc-util.h"
 #include "bus-get-properties.h"
-#include "bus-internal.h"
 #include "bus-log-control-api.h"
+#include "bus-object.h"
 #include "bus-polkit.h"
-#include "bus-protocol.h"
 #include "bus-util.h"
 #include "dns-domain.h"
 #include "in-addr-util.h"
 #include "log.h"
-#include "macro.h"
 #include "strv.h"
 #include "time-util.h"
 #include "timesyncd-bus.h"
 #include "timesyncd-manager.h"
 #include "timesyncd-server.h"
-#include "user-util.h"
 
 static int property_get_servers(
                 sd_bus *bus,
index 4ad25a0a6a74dd6514ad9b1ea45b08d48738c24b..57c272d6a53f32c36d180d2e8bccadd16b8e8b95 100644 (file)
@@ -1,9 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "bus-object.h"
-
-typedef struct Manager Manager;
+#include "timesyncd-forward.h"
 
 extern const BusObjectImplementation manager_object;
 
index 4b1d4ddbfe42dd4825d6ecc96f45fddd1e70d498..0c7d9f39c1470b4fc3d2d220d29301b6536f42a4 100644 (file)
@@ -1,9 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include "alloc-util.h"
-#include "constants.h"
+#include "conf-parser.h"
 #include "dns-domain.h"
 #include "extract-word.h"
+#include "log.h"
 #include "string-util.h"
 #include "timesyncd-conf.h"
 #include "timesyncd-manager.h"
index f0f1ab5cdf8e6d6b3e761c89e51acf0305446ca4..745ba74b5c7497a05ed669b024f2a44edbf049df 100644 (file)
@@ -1,10 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "conf-parser.h"
-#include "timesyncd-server.h"
-
-typedef struct Manager Manager;
+#include "timesyncd-forward.h"
 
 const struct ConfigPerfItem* timesyncd_gperf_lookup(const char *key, GPERF_LEN_TYPE length);
 
diff --git a/src/timesync/timesyncd-forward.h b/src/timesync/timesyncd-forward.h
new file mode 100644 (file)
index 0000000..7a63e38
--- /dev/null
@@ -0,0 +1,11 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#include "conf-parser-forward.h"    /* IWYU pragma: export */
+#include "forward.h"                /* IWYU pragma: export */
+
+typedef enum ServerType ServerType;
+
+typedef struct Manager Manager;
+typedef struct ServerAddress ServerAddress;
+typedef struct ServerName ServerName;
index 69d6703949c6569363f922db1991dd6f8aaa5654..88ad026595bce362b4421dd60d835840590a4e61 100644 (file)
@@ -1,27 +1,26 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
 #include <math.h>
+#include <netdb.h>
 #include <netinet/in.h>
 #include <netinet/ip.h>
 #include <resolv.h>
-#include <stdlib.h>
-#include <sys/timerfd.h>
-#include <sys/timex.h>
-#include <sys/types.h>
 
+#include "sd-bus.h"
 #include "sd-daemon.h"
 #include "sd-messages.h"
+#include "sd-network.h"
 
 #include "alloc-util.h"
-#include "bus-polkit.h"
 #include "clock-util.h"
 #include "common-signal.h"
 #include "dns-domain.h"
+#include "errno-util.h"
 #include "event-util.h"
 #include "fd-util.h"
 #include "format-util.h"
 #include "fs-util.h"
+#include "hashmap.h"
 #include "list.h"
 #include "log.h"
 #include "logarithm.h"
 #include "string-util.h"
 #include "strv.h"
 #include "time-util.h"
-#include "timesyncd-conf.h"
 #include "timesyncd-manager.h"
 #include "timesyncd-server.h"
-#include "user-util.h"
 
 #ifndef ADJ_SETOFFSET
 #define ADJ_SETOFFSET                   0x0100  /* add 'time' to current time */
index 371a7ca1118644d8bf169a72320007504823cad3..252e5164d338a3c8e99461c95e9890b17823d6bb 100644 (file)
@@ -1,23 +1,12 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include <sys/timex.h>
-
-#include "sd-bus.h"
-#include "sd-event.h"
-#include "sd-network.h"
-#include "sd-resolve.h"
-
-#include "hashmap.h"
 #include "list.h"
 #include "ratelimit.h"
 #include "time-util.h"
+#include "timesyncd-forward.h"
 #include "timesyncd-ntp-message.h"
 
-typedef enum ServerType ServerType;
-typedef struct ServerAddress ServerAddress;
-typedef struct ServerName ServerName;
-
 /*
  * "A client MUST NOT under any conditions use a poll interval less
  * than 15 seconds."
index fc122cbb9abaf172ab3a6aa3aaf26a8e3b265418..ee6a6d7a77a1465edfb72fdbbaa6948b4c16796e 100644 (file)
@@ -1,8 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "macro.h"
 #include "sparse-endian.h"
+#include "timesyncd-forward.h"
 
 /* NTP protocol, packet header */
 #define NTP_LEAP_PLUSSEC                1
index dac74199ff04d55e681b47b3cc63b8a4ff9e3666..ba3d9ff183b41f1ab2b69e7a3e75187e9bdc62c0 100644 (file)
@@ -3,10 +3,7 @@
 
 #include "list.h"
 #include "socket-util.h"
-
-typedef struct Manager Manager;
-typedef struct ServerAddress ServerAddress;
-typedef struct ServerName ServerName;
+#include "timesyncd-forward.h"
 
 typedef enum ServerType {
         SERVER_SYSTEM,
index 6537f1ae9234efd8072a716463b05fcbc0e38296..822662c0169083bae1fab42c6f6e8bb420fc791d 100644 (file)
@@ -1,24 +1,25 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <sys/stat.h>
-#include <sys/types.h>
 
-#include "sd-daemon.h"
 #include "sd-event.h"
 #include "sd-messages.h"
 
 #include "bus-log-control-api.h"
+#include "bus-object.h"
 #include "capability-util.h"
 #include "clock-util.h"
 #include "daemon-util.h"
+#include "errno-util.h"
 #include "fd-util.h"
+#include "format-util.h"
 #include "fs-util.h"
+#include "log.h"
 #include "main-func.h"
 #include "mkdir-label.h"
 #include "network-util.h"
 #include "process-util.h"
 #include "service-util.h"
-#include "signal-util.h"
 #include "timesyncd-bus.h"
 #include "timesyncd-conf.h"
 #include "timesyncd-manager.h"
index fa34138875e020d3efd81f3582814bf8c4f10443..f593b420b750d36f1cf42acd73ea487668a87b53 100644 (file)
@@ -1,13 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 /* systemd service to wait until kernel realtime clock is synchronized */
 
-#include <errno.h>
-#include <stdbool.h>
 #include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
 #include <sys/inotify.h>
-#include <sys/timerfd.h>
 #include <sys/timex.h>
 #include <unistd.h>
 
@@ -16,8 +11,8 @@
 #include "errno-util.h"
 #include "fd-util.h"
 #include "inotify-util.h"
+#include "log.h"
 #include "main-func.h"
-#include "signal-util.h"
 #include "time-util.h"
 
 typedef struct ClockState {