timesync: Clean up includes

Split out of #37344.
This commit is contained in:
Daan De Meyer
2025-05-21 10:49:43 +02:00
parent 8c30d82664
commit 9301880442
12 changed files with 29 additions and 51 deletions
-2
View 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"
+1 -7
View 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,
+1 -3
View 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;
+2 -1
View 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"
+1 -4
View 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);
+11
View File
@@ -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;
+5 -8
View 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"
@@ -33,10 +32,8 @@
#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 */
+1 -12
View 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."
+1 -1
View 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
+1 -4
View 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,
+4 -3
View 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"
+1 -6
View 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 {