summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
Diffstat (limited to 'src/core')
-rw-r--r--src/core/automount.c2
-rw-r--r--src/core/busname.h1
-rw-r--r--src/core/cgroup.h1
-rw-r--r--src/core/dbus-automount.c2
-rw-r--r--src/core/dbus-automount.h1
-rw-r--r--src/core/dbus-busname.c1
-rw-r--r--src/core/dbus-busname.h2
-rw-r--r--src/core/dbus-device.c1
-rw-r--r--src/core/dbus-device.h1
-rw-r--r--src/core/dbus-manager.h1
-rw-r--r--src/core/dbus-mount.c1
-rw-r--r--src/core/dbus-path.c1
-rw-r--r--src/core/dbus-path.h1
-rw-r--r--src/core/dbus-service.c1
-rw-r--r--src/core/dbus-slice.c1
-rw-r--r--src/core/dbus-snapshot.c1
-rw-r--r--src/core/dbus-socket.c2
-rw-r--r--src/core/dbus-swap.c2
-rw-r--r--src/core/dbus-target.c2
-rw-r--r--src/core/dbus-target.h1
-rw-r--r--src/core/dbus-timer.c2
-rw-r--r--src/core/dbus-unit.c3
-rw-r--r--src/core/dbus.c1
-rw-r--r--src/core/device.c2
-rw-r--r--src/core/device.h1
-rw-r--r--src/core/execute.c14
-rw-r--r--src/core/execute.h5
-rw-r--r--src/core/failure-action.c1
-rw-r--r--src/core/hostname-setup.c2
-rw-r--r--src/core/ima-setup.c3
-rw-r--r--src/core/job.c5
-rw-r--r--src/core/job.h4
-rw-r--r--src/core/kill.c1
-rw-r--r--src/core/killall.c1
-rw-r--r--src/core/kmod-setup.c3
-rw-r--r--src/core/load-dropin.c3
-rw-r--r--src/core/load-fragment.c8
-rw-r--r--src/core/locale-setup.c2
-rw-r--r--src/core/loopback-setup.c8
-rw-r--r--src/core/machine-id-setup.c1
-rw-r--r--src/core/main.c5
-rw-r--r--src/core/manager.c8
-rw-r--r--src/core/manager.h5
-rw-r--r--src/core/mount-setup.c4
-rw-r--r--src/core/mount.c5
-rw-r--r--src/core/mount.h2
-rw-r--r--src/core/namespace.c8
-rw-r--r--src/core/path.c2
-rw-r--r--src/core/path.h1
-rw-r--r--src/core/scope.c2
-rw-r--r--src/core/scope.h1
-rw-r--r--src/core/selinux-access.c4
-rw-r--r--src/core/selinux-access.h1
-rw-r--r--src/core/selinux-setup.c4
-rw-r--r--src/core/service.c1
-rw-r--r--src/core/service.h2
-rw-r--r--src/core/shutdown.c8
-rw-r--r--src/core/slice.c3
-rw-r--r--src/core/slice.h1
-rw-r--r--src/core/smack-setup.c6
-rw-r--r--src/core/snapshot.h1
-rw-r--r--src/core/socket.c4
-rw-r--r--src/core/socket.h2
-rw-r--r--src/core/swap.c7
-rw-r--r--src/core/swap.h1
-rw-r--r--src/core/target.c4
-rw-r--r--src/core/target.h1
-rw-r--r--src/core/timer.c1
-rw-r--r--src/core/timer.h1
-rw-r--r--src/core/transaction.c1
-rw-r--r--src/core/umount.c1
-rw-r--r--src/core/unit-printf.c3
-rw-r--r--src/core/unit.c6
-rw-r--r--src/core/unit.h9
74 files changed, 4 insertions, 207 deletions
diff --git a/src/core/automount.c b/src/core/automount.c
index 9f6bd84b21..4a509efaf4 100644
--- a/src/core/automount.c
+++ b/src/core/automount.c
@@ -32,8 +32,6 @@
#include "unit.h"
#include "automount.h"
#include "mount.h"
-#include "load-fragment.h"
-#include "load-dropin.h"
#include "unit-name.h"
#include "special.h"
#include "label.h"
diff --git a/src/core/busname.h b/src/core/busname.h
index 775822d8de..69528a2aef 100644
--- a/src/core/busname.h
+++ b/src/core/busname.h
@@ -24,7 +24,6 @@
typedef struct BusName BusName;
typedef struct BusNamePolicy BusNamePolicy;
-#include "unit.h"
typedef enum BusNameState {
BUSNAME_DEAD,
diff --git a/src/core/cgroup.h b/src/core/cgroup.h
index 8fa851de32..993aa9db7d 100644
--- a/src/core/cgroup.h
+++ b/src/core/cgroup.h
@@ -91,7 +91,6 @@ struct CGroupContext {
};
#include "unit.h"
-#include "manager.h"
#include "cgroup-util.h"
void cgroup_context_init(CGroupContext *c);
diff --git a/src/core/dbus-automount.c b/src/core/dbus-automount.c
index b2a510ad09..38acbd0c26 100644
--- a/src/core/dbus-automount.c
+++ b/src/core/dbus-automount.c
@@ -19,9 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "unit.h"
#include "automount.h"
-#include "dbus-unit.h"
#include "dbus-automount.h"
#include "bus-util.h"
diff --git a/src/core/dbus-automount.h b/src/core/dbus-automount.h
index 1bec953788..a2b124d756 100644
--- a/src/core/dbus-automount.h
+++ b/src/core/dbus-automount.h
@@ -21,6 +21,5 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "sd-bus.h"
extern const sd_bus_vtable bus_automount_vtable[];
diff --git a/src/core/dbus-busname.c b/src/core/dbus-busname.c
index 28f192403b..b1ceb05b1a 100644
--- a/src/core/dbus-busname.c
+++ b/src/core/dbus-busname.c
@@ -21,7 +21,6 @@
#include "unit.h"
#include "busname.h"
-#include "dbus-unit.h"
#include "dbus-busname.h"
#include "bus-util.h"
diff --git a/src/core/dbus-busname.h b/src/core/dbus-busname.h
index b5eed37d58..ea55b6c8c9 100644
--- a/src/core/dbus-busname.h
+++ b/src/core/dbus-busname.h
@@ -21,7 +21,5 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "sd-bus.h"
-#include "unit.h"
extern const sd_bus_vtable bus_busname_vtable[];
diff --git a/src/core/dbus-device.c b/src/core/dbus-device.c
index f556536f33..cb156fd37c 100644
--- a/src/core/dbus-device.c
+++ b/src/core/dbus-device.c
@@ -21,7 +21,6 @@
#include "unit.h"
#include "device.h"
-#include "dbus-unit.h"
#include "dbus-device.h"
const sd_bus_vtable bus_device_vtable[] = {
diff --git a/src/core/dbus-device.h b/src/core/dbus-device.h
index 4aff226ab2..10e945e402 100644
--- a/src/core/dbus-device.h
+++ b/src/core/dbus-device.h
@@ -21,7 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "sd-bus.h"
#include "unit.h"
extern const sd_bus_vtable bus_device_vtable[];
diff --git a/src/core/dbus-manager.h b/src/core/dbus-manager.h
index e1903fa16a..3730deb576 100644
--- a/src/core/dbus-manager.h
+++ b/src/core/dbus-manager.h
@@ -21,7 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "sd-bus.h"
#include "manager.h"
extern const sd_bus_vtable bus_manager_vtable[];
diff --git a/src/core/dbus-mount.c b/src/core/dbus-mount.c
index 53fe4edc34..24813c6d20 100644
--- a/src/core/dbus-mount.c
+++ b/src/core/dbus-mount.c
@@ -21,7 +21,6 @@
#include "unit.h"
#include "mount.h"
-#include "dbus-unit.h"
#include "dbus-execute.h"
#include "dbus-kill.h"
#include "dbus-cgroup.h"
diff --git a/src/core/dbus-path.c b/src/core/dbus-path.c
index b5e894101d..683561999b 100644
--- a/src/core/dbus-path.c
+++ b/src/core/dbus-path.c
@@ -21,7 +21,6 @@
#include "unit.h"
#include "path.h"
-#include "dbus-unit.h"
#include "dbus-path.h"
#include "bus-util.h"
diff --git a/src/core/dbus-path.h b/src/core/dbus-path.h
index 667da05223..389b0d7f9b 100644
--- a/src/core/dbus-path.h
+++ b/src/core/dbus-path.h
@@ -22,6 +22,5 @@
***/
-#include "sd-bus.h"
extern const sd_bus_vtable bus_path_vtable[];
diff --git a/src/core/dbus-service.c b/src/core/dbus-service.c
index 6d4713babc..e1f3d56495 100644
--- a/src/core/dbus-service.c
+++ b/src/core/dbus-service.c
@@ -23,7 +23,6 @@
#include "path-util.h"
#include "unit.h"
#include "service.h"
-#include "dbus-unit.h"
#include "dbus-execute.h"
#include "dbus-kill.h"
#include "dbus-cgroup.h"
diff --git a/src/core/dbus-slice.c b/src/core/dbus-slice.c
index 8bc90b1dad..09e78d1f33 100644
--- a/src/core/dbus-slice.c
+++ b/src/core/dbus-slice.c
@@ -21,7 +21,6 @@
#include "unit.h"
#include "slice.h"
-#include "dbus-unit.h"
#include "dbus-cgroup.h"
#include "dbus-slice.h"
diff --git a/src/core/dbus-snapshot.c b/src/core/dbus-snapshot.c
index a1959defce..0be46c288e 100644
--- a/src/core/dbus-snapshot.c
+++ b/src/core/dbus-snapshot.c
@@ -23,7 +23,6 @@
#include "unit.h"
#include "dbus.h"
#include "snapshot.h"
-#include "dbus-unit.h"
#include "dbus-snapshot.h"
int bus_snapshot_method_remove(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
diff --git a/src/core/dbus-socket.c b/src/core/dbus-socket.c
index 50b1674427..02599a9e55 100644
--- a/src/core/dbus-socket.c
+++ b/src/core/dbus-socket.c
@@ -21,9 +21,7 @@
#include "unit.h"
#include "socket.h"
-#include "dbus-unit.h"
#include "dbus-execute.h"
-#include "dbus-kill.h"
#include "dbus-cgroup.h"
#include "dbus-socket.h"
#include "bus-util.h"
diff --git a/src/core/dbus-swap.c b/src/core/dbus-swap.c
index 1e7f66d053..0093371306 100644
--- a/src/core/dbus-swap.c
+++ b/src/core/dbus-swap.c
@@ -22,9 +22,7 @@
#include "unit.h"
#include "swap.h"
-#include "dbus-unit.h"
#include "dbus-execute.h"
-#include "dbus-kill.h"
#include "dbus-cgroup.h"
#include "dbus-swap.h"
#include "bus-util.h"
diff --git a/src/core/dbus-target.c b/src/core/dbus-target.c
index 205d1c4a88..350f5c3ed2 100644
--- a/src/core/dbus-target.c
+++ b/src/core/dbus-target.c
@@ -20,8 +20,6 @@
***/
#include "unit.h"
-#include "target.h"
-#include "dbus-unit.h"
#include "dbus-target.h"
const sd_bus_vtable bus_target_vtable[] = {
diff --git a/src/core/dbus-target.h b/src/core/dbus-target.h
index 6be9c9f708..4c4297bc9e 100644
--- a/src/core/dbus-target.h
+++ b/src/core/dbus-target.h
@@ -21,6 +21,5 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "sd-bus.h"
extern const sd_bus_vtable bus_target_vtable[];
diff --git a/src/core/dbus-timer.c b/src/core/dbus-timer.c
index 43e785246c..74a9914358 100644
--- a/src/core/dbus-timer.c
+++ b/src/core/dbus-timer.c
@@ -21,10 +21,8 @@
#include "unit.h"
#include "timer.h"
-#include "dbus-unit.h"
#include "dbus-timer.h"
#include "bus-util.h"
-#include "errno-list.h"
#include "strv.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_result, timer_result, TimerResult);
diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c
index fba3f7cc70..0ff9a01e11 100644
--- a/src/core/dbus-unit.c
+++ b/src/core/dbus-unit.c
@@ -24,11 +24,8 @@
#include "selinux-access.h"
#include "cgroup-util.h"
#include "strv.h"
-#include "path-util.h"
-#include "fileio.h"
#include "bus-common-errors.h"
#include "dbus.h"
-#include "dbus-manager.h"
#include "dbus-unit.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_load_state, unit_load_state, UnitLoadState);
diff --git a/src/core/dbus.c b/src/core/dbus.c
index e7cf93dc6c..5dcb0d1c98 100644
--- a/src/core/dbus.c
+++ b/src/core/dbus.c
@@ -20,7 +20,6 @@
***/
#include <sys/epoll.h>
-#include <sys/timerfd.h>
#include <errno.h>
#include <unistd.h>
diff --git a/src/core/device.c b/src/core/device.c
index d3deac3936..2d983cc565 100644
--- a/src/core/device.c
+++ b/src/core/device.c
@@ -23,11 +23,9 @@
#include <sys/epoll.h>
#include <libudev.h>
-#include "strv.h"
#include "log.h"
#include "unit-name.h"
#include "dbus-device.h"
-#include "def.h"
#include "path-util.h"
#include "udev-util.h"
#include "unit.h"
diff --git a/src/core/device.h b/src/core/device.h
index bb7ae07834..906508530d 100644
--- a/src/core/device.h
+++ b/src/core/device.h
@@ -23,7 +23,6 @@
typedef struct Device Device;
-#include "unit.h"
/* We simply watch devices, we cannot plug/unplug them. That
* simplifies the state engine greatly */
diff --git a/src/core/execute.c b/src/core/execute.c
index 1815e3de2d..39ec5adbbe 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
-#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
@@ -29,14 +27,8 @@
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/prctl.h>
-#include <linux/sched.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <grp.h>
-#include <pwd.h>
-#include <sys/mount.h>
-#include <linux/fs.h>
-#include <linux/oom.h>
#include <poll.h>
#include <glob.h>
#include <sys/personality.h>
@@ -80,12 +72,14 @@
#include "errno-list.h"
#include "af-list.h"
#include "mkdir.h"
-#include "apparmor-util.h"
#include "smack-util.h"
#include "bus-endpoint.h"
-#include "label.h"
#include "cap-list.h"
+#ifdef HAVE_APPARMOR
+#include "apparmor-util.h"
+#endif
+
#ifdef HAVE_SECCOMP
#include "seccomp-util.h"
#endif
diff --git a/src/core/execute.h b/src/core/execute.h
index 6e0c9faa75..1a43ac77b0 100644
--- a/src/core/execute.h
+++ b/src/core/execute.h
@@ -27,17 +27,12 @@ typedef struct ExecContext ExecContext;
typedef struct ExecRuntime ExecRuntime;
typedef struct ExecParameters ExecParameters;
-#include <linux/types.h>
-#include <sys/time.h>
-#include <sys/resource.h>
#include <sys/capability.h>
#include <stdbool.h>
#include <stdio.h>
#include <sched.h>
#include "list.h"
-#include "util.h"
-#include "set.h"
#include "fdset.h"
#include "missing.h"
#include "namespace.h"
diff --git a/src/core/failure-action.c b/src/core/failure-action.c
index ce522a4e4f..ffeb5cd31b 100644
--- a/src/core/failure-action.c
+++ b/src/core/failure-action.c
@@ -22,7 +22,6 @@
#include <sys/reboot.h>
#include <linux/reboot.h>
-#include <sys/syscall.h>
#include "bus-util.h"
#include "bus-error.h"
diff --git a/src/core/hostname-setup.c b/src/core/hostname-setup.c
index 6664e8952c..03b0ce3b4d 100644
--- a/src/core/hostname-setup.c
+++ b/src/core/hostname-setup.c
@@ -19,10 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <unistd.h>
#include <stdio.h>
#include <errno.h>
-#include <string.h>
#include <stdlib.h>
#include "hostname-setup.h"
diff --git a/src/core/ima-setup.c b/src/core/ima-setup.c
index 0e0d16a7c9..7721b3ecaf 100644
--- a/src/core/ima-setup.c
+++ b/src/core/ima-setup.c
@@ -22,10 +22,7 @@
***/
#include <unistd.h>
-#include <stdio.h>
#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
#include "ima-setup.h"
diff --git a/src/core/job.c b/src/core/job.c
index 4740ff18cb..db7ebae6b1 100644
--- a/src/core/job.c
+++ b/src/core/job.c
@@ -19,10 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <errno.h>
-#include <sys/timerfd.h>
-#include <sys/epoll.h>
#include "sd-id128.h"
#include "sd-messages.h"
@@ -30,8 +27,6 @@
#include "unit.h"
#include "macro.h"
#include "strv.h"
-#include "load-fragment.h"
-#include "load-dropin.h"
#include "log.h"
#include "dbus-job.h"
#include "special.h"
diff --git a/src/core/job.h b/src/core/job.h
index d967b68a3f..9119e4834a 100644
--- a/src/core/job.h
+++ b/src/core/job.h
@@ -22,8 +22,6 @@
***/
#include <stdbool.h>
-#include <inttypes.h>
-#include <errno.h>
typedef struct Job Job;
typedef struct JobDependency JobDependency;
@@ -108,9 +106,7 @@ enum JobResult {
};
#include "sd-event.h"
-#include "manager.h"
#include "unit.h"
-#include "hashmap.h"
#include "list.h"
struct JobDependency {
diff --git a/src/core/kill.c b/src/core/kill.c
index 4271346511..60a510eae6 100644
--- a/src/core/kill.c
+++ b/src/core/kill.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <string.h>
#include "kill.h"
#include "util.h"
diff --git a/src/core/killall.c b/src/core/killall.c
index 5a50ae6f04..c6f1ddfec8 100644
--- a/src/core/killall.c
+++ b/src/core/killall.c
@@ -25,7 +25,6 @@
#include <unistd.h>
#include "util.h"
-#include "def.h"
#include "killall.h"
#include "set.h"
diff --git a/src/core/kmod-setup.c b/src/core/kmod-setup.c
index c0a05b97aa..efbdf31688 100644
--- a/src/core/kmod-setup.c
+++ b/src/core/kmod-setup.c
@@ -19,17 +19,14 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/wait.h>
#include <unistd.h>
#include <string.h>
-#include <errno.h>
#ifdef HAVE_KMOD
#include <libkmod.h>
#endif
#include "macro.h"
-#include "execute.h"
#include "capability.h"
#include "kmod-setup.h"
diff --git a/src/core/load-dropin.c b/src/core/load-dropin.c
index 8be190040e..11566af51b 100644
--- a/src/core/load-dropin.c
+++ b/src/core/load-dropin.c
@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <dirent.h>
-#include <errno.h>
#include "unit.h"
#include "load-dropin.h"
@@ -29,7 +27,6 @@
#include "unit-name.h"
#include "conf-parser.h"
#include "load-fragment.h"
-#include "conf-files.h"
static int add_dependency_consumer(
UnitDependency dependency,
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 90bf5634c8..6d0192fc72 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -21,26 +21,18 @@
***/
#include <linux/oom.h>
-#include <assert.h>
#include <errno.h>
#include <string.h>
-#include <unistd.h>
#include <fcntl.h>
#include <sched.h>
-#include <sys/prctl.h>
-#include <sys/mount.h>
#include <linux/fs.h>
#include <sys/stat.h>
-#include <sys/time.h>
#include <sys/resource.h>
-#include <sys/types.h>
-#include <grp.h>
#ifdef HAVE_SECCOMP
#include <seccomp.h>
#endif
-#include "sd-messages.h"
#include "unit.h"
#include "strv.h"
#include "conf-parser.h"
diff --git a/src/core/locale-setup.c b/src/core/locale-setup.c
index e993c57321..108072ca9f 100644
--- a/src/core/locale-setup.c
+++ b/src/core/locale-setup.c
@@ -19,13 +19,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include "locale-setup.h"
#include "util.h"
-#include "macro.h"
#include "virt.h"
#include "fileio.h"
#include "strv.h"
diff --git a/src/core/loopback-setup.c b/src/core/loopback-setup.c
index 67ce160c19..63b15c1200 100644
--- a/src/core/loopback-setup.c
+++ b/src/core/loopback-setup.c
@@ -19,18 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/socket.h>
#include <net/if.h>
-#include <asm/types.h>
-#include <netinet/in.h>
-#include <string.h>
#include <stdlib.h>
-#include <unistd.h>
#include "sd-rtnl.h"
-#include "util.h"
-#include "macro.h"
-#include "socket-util.h"
#include "rtnl-util.h"
#include "missing.h"
#include "loopback-setup.h"
diff --git a/src/core/machine-id-setup.c b/src/core/machine-id-setup.c
index d00a53246f..063f705ede 100644
--- a/src/core/machine-id-setup.c
+++ b/src/core/machine-id-setup.c
@@ -23,7 +23,6 @@
#include <stdio.h>
#include <errno.h>
#include <string.h>
-#include <stdlib.h>
#include <fcntl.h>
#include <sys/mount.h>
diff --git a/src/core/main.c b/src/core/main.c
index 08f46f569a..d68e73769a 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -23,11 +23,9 @@
#include <errno.h>
#include <string.h>
#include <unistd.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <getopt.h>
#include <signal.h>
-#include <sys/wait.h>
#include <fcntl.h>
#include <sys/prctl.h>
#include <sys/mount.h>
@@ -40,14 +38,12 @@
#endif
#include "sd-daemon.h"
-#include "sd-messages.h"
#include "sd-bus.h"
#include "log.h"
#include "fdset.h"
#include "special.h"
#include "conf-parser.h"
#include "missing.h"
-#include "label.h"
#include "pager.h"
#include "build.h"
#include "strv.h"
@@ -55,7 +51,6 @@
#include "virt.h"
#include "architecture.h"
#include "watchdog.h"
-#include "path-util.h"
#include "switch-root.h"
#include "capability.h"
#include "killall.h"
diff --git a/src/core/manager.c b/src/core/manager.c
index 4775219e4a..79a9d54954 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
@@ -27,14 +26,10 @@
#include <unistd.h>
#include <sys/inotify.h>
#include <sys/epoll.h>
-#include <poll.h>
#include <sys/reboot.h>
#include <sys/ioctl.h>
#include <linux/kd.h>
-#include <termios.h>
#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <dirent.h>
#include <sys/timerfd.h>
@@ -43,7 +38,6 @@
#endif
#include "sd-daemon.h"
-#include "sd-id128.h"
#include "sd-messages.h"
#include "manager.h"
@@ -56,7 +50,6 @@
#include "mkdir.h"
#include "ratelimit.h"
#include "locale-setup.h"
-#include "mount-setup.h"
#include "unit-name.h"
#include "missing.h"
#include "path-lookup.h"
@@ -64,7 +57,6 @@
#include "exit-status.h"
#include "virt.h"
#include "watchdog.h"
-#include "cgroup-util.h"
#include "path-util.h"
#include "audit-fd.h"
#include "boot-timestamps.h"
diff --git a/src/core/manager.h b/src/core/manager.h
index d3971f1684..4e33ba63f4 100644
--- a/src/core/manager.h
+++ b/src/core/manager.h
@@ -22,7 +22,6 @@
***/
#include <stdbool.h>
-#include <inttypes.h>
#include <stdio.h>
#include "sd-bus.h"
@@ -31,7 +30,6 @@
#include "cgroup-util.h"
#include "hashmap.h"
#include "list.h"
-#include "set.h"
#include "ratelimit.h"
/* Enforce upper limit how many names we allow */
@@ -70,14 +68,11 @@ typedef enum StatusType {
STATUS_TYPE_EMERGENCY,
} StatusType;
-#include "unit.h"
#include "job.h"
#include "path-lookup.h"
#include "execute.h"
#include "unit-name.h"
-#include "exit-status.h"
#include "show-status.h"
-#include "failure-action.h"
struct Manager {
/* Note that the set of units we know of is allowed to be
diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c
index 521545e5ce..343ff066a9 100644
--- a/src/core/mount-setup.c
+++ b/src/core/mount-setup.c
@@ -21,10 +21,7 @@
#include <sys/mount.h>
#include <errno.h>
-#include <sys/stat.h>
#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
#include <unistd.h>
#include <ftw.h>
@@ -42,7 +39,6 @@
#include "virt.h"
#include "efivars.h"
#include "smack-util.h"
-#include "def.h"
#include "cgroup-util.h"
typedef enum MountMode {
diff --git a/src/core/mount.c b/src/core/mount.c
index f3977e62de..40037e7866 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -21,7 +21,6 @@
#include <errno.h>
#include <stdio.h>
-#include <mntent.h>
#include <sys/epoll.h>
#include <signal.h>
#include <libmount.h>
@@ -30,8 +29,6 @@
#include "manager.h"
#include "unit.h"
#include "mount.h"
-#include "load-fragment.h"
-#include "load-dropin.h"
#include "log.h"
#include "sd-messages.h"
#include "strv.h"
@@ -41,9 +38,7 @@
#include "unit-name.h"
#include "dbus-mount.h"
#include "special.h"
-#include "bus-common-errors.h"
#include "exit-status.h"
-#include "def.h"
#include "fstab-util.h"
#define RETRY_UMOUNT_MAX 32
diff --git a/src/core/mount.h b/src/core/mount.h
index d6987e6fa1..76771ab7a9 100644
--- a/src/core/mount.h
+++ b/src/core/mount.h
@@ -23,10 +23,8 @@
typedef struct Mount Mount;
-#include "unit.h"
#include "kill.h"
#include "execute.h"
-#include "cgroup.h"
typedef enum MountState {
MOUNT_DEAD,
diff --git a/src/core/namespace.c b/src/core/namespace.c
index 4fecd32363..6a6d119314 100644
--- a/src/core/namespace.c
+++ b/src/core/namespace.c
@@ -25,23 +25,15 @@
#include <stdio.h>
#include <unistd.h>
#include <sys/stat.h>
-#include <sys/types.h>
#include <sched.h>
-#include <sys/syscall.h>
-#include <limits.h>
#include <linux/fs.h>
-#include <sys/file.h>
#include "strv.h"
#include "util.h"
#include "path-util.h"
#include "missing.h"
-#include "execute.h"
#include "loopback-setup.h"
-#include "mkdir.h"
#include "dev-setup.h"
-#include "def.h"
-#include "label.h"
#include "selinux-util.h"
#include "namespace.h"
diff --git a/src/core/path.c b/src/core/path.c
index e5ea79fec7..fbb695d87f 100644
--- a/src/core/path.c
+++ b/src/core/path.c
@@ -21,7 +21,6 @@
#include <sys/inotify.h>
#include <sys/epoll.h>
-#include <sys/ioctl.h>
#include <errno.h>
#include <unistd.h>
@@ -31,7 +30,6 @@
#include "mkdir.h"
#include "dbus-path.h"
#include "special.h"
-#include "path-util.h"
#include "macro.h"
#include "bus-util.h"
#include "bus-error.h"
diff --git a/src/core/path.h b/src/core/path.h
index 0d36aab960..dec39333e4 100644
--- a/src/core/path.h
+++ b/src/core/path.h
@@ -25,7 +25,6 @@ typedef struct Path Path;
typedef struct PathSpec PathSpec;
#include "unit.h"
-#include "mount.h"
typedef enum PathState {
PATH_DEAD,
diff --git a/src/core/scope.c b/src/core/scope.c
index b41db7872c..a0e4732533 100644
--- a/src/core/scope.c
+++ b/src/core/scope.c
@@ -20,12 +20,10 @@
***/
#include <errno.h>
-#include <signal.h>
#include <unistd.h>
#include "unit.h"
#include "scope.h"
-#include "load-fragment.h"
#include "log.h"
#include "dbus-scope.h"
#include "special.h"
diff --git a/src/core/scope.h b/src/core/scope.h
index 6c59126422..4452fe2c94 100644
--- a/src/core/scope.h
+++ b/src/core/scope.h
@@ -23,7 +23,6 @@
typedef struct Scope Scope;
-#include "unit.h"
#include "kill.h"
typedef enum ScopeState {
diff --git a/src/core/selinux-access.c b/src/core/selinux-access.c
index 18888747f2..a8c9a4b888 100644
--- a/src/core/selinux-access.c
+++ b/src/core/selinux-access.c
@@ -24,12 +24,9 @@
#ifdef HAVE_SELINUX
#include <stdio.h>
-#include <string.h>
#include <errno.h>
-#include <limits.h>
#include <selinux/selinux.h>
#include <selinux/avc.h>
-#include <sys/socket.h>
#ifdef HAVE_AUDIT
#include <libaudit.h>
#endif
@@ -38,7 +35,6 @@
#include "bus-util.h"
#include "util.h"
#include "log.h"
-#include "audit.h"
#include "selinux-util.h"
#include "audit-fd.h"
#include "strv.h"
diff --git a/src/core/selinux-access.h b/src/core/selinux-access.h
index dd1e8bb9d0..b5758e2e42 100644
--- a/src/core/selinux-access.h
+++ b/src/core/selinux-access.h
@@ -22,7 +22,6 @@
***/
#include "sd-bus.h"
-#include "bus-error.h"
#include "bus-util.h"
#include "manager.h"
diff --git a/src/core/selinux-setup.c b/src/core/selinux-setup.c
index fba915d7da..a4678500e6 100644
--- a/src/core/selinux-setup.c
+++ b/src/core/selinux-setup.c
@@ -22,8 +22,6 @@
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
#ifdef HAVE_SELINUX
#include <selinux/selinux.h>
@@ -31,8 +29,6 @@
#include "selinux-setup.h"
#include "selinux-util.h"
-#include "label.h"
-#include "mount-setup.h"
#include "macro.h"
#include "util.h"
#include "log.h"
diff --git a/src/core/service.c b/src/core/service.c
index 15e29be149..c7b35050bd 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -21,7 +21,6 @@
#include <errno.h>
#include <signal.h>
-#include <dirent.h>
#include <unistd.h>
#include "async.h"
diff --git a/src/core/service.h b/src/core/service.h
index dfeee6a68c..fe5afef46b 100644
--- a/src/core/service.h
+++ b/src/core/service.h
@@ -24,12 +24,10 @@
typedef struct Service Service;
typedef struct ServiceFDStore ServiceFDStore;
-#include "unit.h"
#include "path.h"
#include "ratelimit.h"
#include "kill.h"
#include "exit-status.h"
-#include "failure-action.h"
typedef enum ServiceState {
SERVICE_DEAD,
diff --git a/src/core/shutdown.c b/src/core/shutdown.c
index 71f001ac13..70a461e38c 100644
--- a/src/core/shutdown.c
+++ b/src/core/shutdown.c
@@ -20,21 +20,15 @@
***/
#include <sys/mman.h>
-#include <sys/types.h>
#include <sys/reboot.h>
#include <linux/reboot.h>
-#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/mount.h>
-#include <sys/syscall.h>
-#include <fcntl.h>
-#include <dirent.h>
#include <errno.h>
#include <unistd.h>
#include <signal.h>
#include <stdbool.h>
#include <stdlib.h>
-#include <string.h>
#include <getopt.h>
#include "missing.h"
@@ -42,14 +36,12 @@
#include "fileio.h"
#include "umount.h"
#include "util.h"
-#include "mkdir.h"
#include "virt.h"
#include "watchdog.h"
#include "killall.h"
#include "cgroup-util.h"
#include "def.h"
#include "switch-root.h"
-#include "strv.h"
#define FINALIZE_ATTEMPTS 50
diff --git a/src/core/slice.c b/src/core/slice.c
index ae9819d015..4d2eaf7ed6 100644
--- a/src/core/slice.c
+++ b/src/core/slice.c
@@ -20,12 +20,9 @@
***/
#include <errno.h>
-#include <signal.h>
-#include <unistd.h>
#include "unit.h"
#include "slice.h"
-#include "load-fragment.h"
#include "log.h"
#include "dbus-slice.h"
#include "special.h"
diff --git a/src/core/slice.h b/src/core/slice.h
index ad0c63902b..ac648e56f8 100644
--- a/src/core/slice.h
+++ b/src/core/slice.h
@@ -23,7 +23,6 @@
typedef struct Slice Slice;
-#include "unit.h"
typedef enum SliceState {
SLICE_DEAD,
diff --git a/src/core/smack-setup.c b/src/core/smack-setup.c
index 59f6832bc2..ff2a02004d 100644
--- a/src/core/smack-setup.c
+++ b/src/core/smack-setup.c
@@ -24,21 +24,15 @@
#include <stdio.h>
#include <errno.h>
#include <string.h>
-#include <unistd.h>
#include <stdlib.h>
-#include <sys/vfs.h>
#include <fcntl.h>
-#include <sys/types.h>
#include <dirent.h>
-#include <sys/mount.h>
-#include <stdint.h>
#include "macro.h"
#include "smack-setup.h"
#include "util.h"
#include "fileio.h"
#include "log.h"
-#include "label.h"
#define SMACK_CONFIG "/etc/smack/accesses.d/"
#define CIPSO_CONFIG "/etc/smack/cipso.d/"
diff --git a/src/core/snapshot.h b/src/core/snapshot.h
index e6dc661060..f2451b1193 100644
--- a/src/core/snapshot.h
+++ b/src/core/snapshot.h
@@ -23,7 +23,6 @@
typedef struct Snapshot Snapshot;
-#include "unit.h"
typedef enum SnapshotState {
SNAPSHOT_DEAD,
diff --git a/src/core/socket.c b/src/core/socket.c
index 88aae4815b..7d052f2ef9 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
@@ -29,12 +28,9 @@
#include <arpa/inet.h>
#include <netinet/tcp.h>
#include <mqueue.h>
-#include <sys/xattr.h>
#include "sd-event.h"
#include "log.h"
-#include "load-dropin.h"
-#include "load-fragment.h"
#include "strv.h"
#include "mkdir.h"
#include "path-util.h"
diff --git a/src/core/socket.h b/src/core/socket.h
index a2e08998c0..5acf214e1c 100644
--- a/src/core/socket.h
+++ b/src/core/socket.h
@@ -23,8 +23,6 @@
typedef struct Socket Socket;
-#include "manager.h"
-#include "unit.h"
#include "socket-util.h"
#include "mount.h"
#include "service.h"
diff --git a/src/core/swap.c b/src/core/swap.c
index 6997921fde..f73a8e6deb 100644
--- a/src/core/swap.c
+++ b/src/core/swap.c
@@ -20,24 +20,17 @@
***/
#include <errno.h>
-#include <limits.h>
#include <unistd.h>
-#include <fcntl.h>
#include <sys/epoll.h>
#include <sys/stat.h>
-#include <sys/swap.h>
#include <libudev.h>
#include "unit.h"
#include "swap.h"
-#include "load-fragment.h"
-#include "load-dropin.h"
#include "unit-name.h"
#include "dbus-swap.h"
#include "special.h"
-#include "bus-common-errors.h"
#include "exit-status.h"
-#include "def.h"
#include "path-util.h"
#include "virt.h"
#include "udev-util.h"
diff --git a/src/core/swap.h b/src/core/swap.h
index 73e64d87a4..c36c6f2ce9 100644
--- a/src/core/swap.h
+++ b/src/core/swap.h
@@ -26,7 +26,6 @@
typedef struct Swap Swap;
-#include "unit.h"
typedef enum SwapState {
SWAP_DEAD,
diff --git a/src/core/target.c b/src/core/target.c
index 33fb66bc3f..8817ef21c4 100644
--- a/src/core/target.c
+++ b/src/core/target.c
@@ -19,13 +19,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <errno.h>
-#include <signal.h>
-#include <unistd.h>
#include "unit.h"
#include "target.h"
-#include "load-fragment.h"
#include "log.h"
#include "dbus-target.h"
#include "special.h"
diff --git a/src/core/target.h b/src/core/target.h
index a5398d9e98..0a25ef469a 100644
--- a/src/core/target.h
+++ b/src/core/target.h
@@ -23,7 +23,6 @@
typedef struct Target Target;
-#include "unit.h"
typedef enum TargetState {
TARGET_DEAD,
diff --git a/src/core/timer.c b/src/core/timer.c
index 45744c7de5..940550194b 100644
--- a/src/core/timer.c
+++ b/src/core/timer.c
@@ -28,7 +28,6 @@
#include "special.h"
#include "bus-util.h"
#include "bus-error.h"
-#include "mkdir.h"
static const UnitActiveState state_translation_table[_TIMER_STATE_MAX] = {
[TIMER_DEAD] = UNIT_INACTIVE,
diff --git a/src/core/timer.h b/src/core/timer.h
index de412a043e..9d919e4d3e 100644
--- a/src/core/timer.h
+++ b/src/core/timer.h
@@ -23,7 +23,6 @@
typedef struct Timer Timer;
-#include "unit.h"
#include "calendarspec.h"
typedef enum TimerState {
diff --git a/src/core/transaction.c b/src/core/transaction.c
index b0b3d6bd60..64c2af5a1c 100644
--- a/src/core/transaction.c
+++ b/src/core/transaction.c
@@ -23,7 +23,6 @@
#include <fcntl.h>
#include "bus-common-errors.h"
-#include "bus-util.h"
#include "bus-error.h"
#include "transaction.h"
diff --git a/src/core/umount.c b/src/core/umount.c
index dd7df194de..ceee70fbea 100644
--- a/src/core/umount.c
+++ b/src/core/umount.c
@@ -24,7 +24,6 @@
#include <string.h>
#include <sys/mount.h>
#include <sys/swap.h>
-#include <unistd.h>
#include <linux/loop.h>
#include <linux/dm-ioctl.h>
diff --git a/src/core/unit-printf.c b/src/core/unit-printf.c
index 97135db551..7736899a35 100644
--- a/src/core/unit-printf.c
+++ b/src/core/unit-printf.c
@@ -19,16 +19,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "sd-id128.h"
#include "unit.h"
#include "specifier.h"
-#include "path-util.h"
#include "strv.h"
#include "unit-name.h"
#include "unit-printf.h"
#include "macro.h"
#include "cgroup-util.h"
-#include "special.h"
static int specifier_prefix_and_instance(char specifier, void *data, void *userdata, char **ret) {
Unit *u = userdata;
diff --git a/src/core/unit.c b/src/core/unit.c
index ee8e607c27..ad5348b57b 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -19,12 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <errno.h>
#include <string.h>
-#include <sys/epoll.h>
-#include <sys/timerfd.h>
-#include <poll.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
@@ -45,12 +41,10 @@
#include "cgroup-util.h"
#include "missing.h"
#include "mkdir.h"
-#include "label.h"
#include "fileio-label.h"
#include "bus-common-errors.h"
#include "dbus.h"
#include "execute.h"
-#include "virt.h"
#include "dropin.h"
const UnitVTable * const unit_vtable[_UNIT_TYPE_MAX] = {
diff --git a/src/core/unit.h b/src/core/unit.h
index 291bc77a76..b3775d4d89 100644
--- a/src/core/unit.h
+++ b/src/core/unit.h
@@ -31,13 +31,7 @@ typedef enum UnitActiveState UnitActiveState;
typedef struct UnitRef UnitRef;
typedef struct UnitStatusMessageFormats UnitStatusMessageFormats;
-#include "sd-event.h"
-#include "set.h"
-#include "util.h"
#include "list.h"
-#include "socket-util.h"
-#include "execute.h"
-#include "cgroup.h"
#include "condition.h"
#include "install.h"
#include "unit-name.h"
@@ -76,7 +70,6 @@ static inline bool UNIT_IS_INACTIVE_OR_FAILED(UnitActiveState t) {
return t == UNIT_INACTIVE || t == UNIT_FAILED;
}
-#include "manager.h"
#include "job.h"
struct UnitRef {
@@ -249,13 +242,11 @@ typedef enum UnitSetPropertiesMode {
UNIT_PERSISTENT = 2,
} UnitSetPropertiesMode;
-#include "service.h"
#include "socket.h"
#include "busname.h"
#include "target.h"
#include "snapshot.h"
#include "device.h"
-#include "mount.h"
#include "automount.h"
#include "swap.h"
#include "timer.h"