summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorThomas Hindoe Paaboel Andersen <phomes@gmail.com>2015-02-14 09:44:31 +0100
committerThomas Hindoe Paaboel Andersen <phomes@gmail.com>2015-02-23 23:53:42 +0100
commit2eec67acbb00593e414549a7e5b35eb7dd776b1b (patch)
treec692391dddfa88d938a29ea238a9e1a95da879fc /src
parent4aab5d0cbd979b2cccb88534f118bceaa86466d8 (diff)
remove unused includes
This patch removes includes that are not used. The removals were found with include-what-you-use which checks if any of the symbols from a header is in use.
Diffstat (limited to 'src')
-rw-r--r--src/activate/activate.c1
-rw-r--r--src/analyze/analyze-verify.c2
-rw-r--r--src/analyze/analyze.c3
-rw-r--r--src/ask-password/ask-password.c12
-rw-r--r--src/binfmt/binfmt.c2
-rw-r--r--src/boot/bootctl.c1
-rw-r--r--src/bootchart/bootchart.c3
-rw-r--r--src/bootchart/bootchart.h1
-rw-r--r--src/bootchart/store.c2
-rw-r--r--src/bootchart/svg.c3
-rw-r--r--src/bus-proxyd/bus-proxyd.c14
-rw-r--r--src/bus-proxyd/bus-xml-policy.c1
-rw-r--r--src/bus-proxyd/bus-xml-policy.h2
-rw-r--r--src/bus-proxyd/driver.c7
-rw-r--r--src/bus-proxyd/proxy.c10
-rw-r--r--src/bus-proxyd/proxy.h2
-rw-r--r--src/bus-proxyd/stdio-bridge.c14
-rw-r--r--src/bus-proxyd/synthesize.c8
-rw-r--r--src/bus-proxyd/test-bus-xml-policy.c13
-rw-r--r--src/cgls/cgls.c1
-rw-r--r--src/console/consoled-display.c1
-rw-r--r--src/console/consoled-manager.c3
-rw-r--r--src/console/consoled-session.c4
-rw-r--r--src/console/consoled-terminal.c1
-rw-r--r--src/console/consoled-workspace.c1
-rw-r--r--src/console/consoled.c2
-rw-r--r--src/console/consoled.h4
-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
-rw-r--r--src/cryptsetup/cryptsetup-generator.c3
-rw-r--r--src/cryptsetup/cryptsetup.c1
-rw-r--r--src/delta/delta.c1
-rw-r--r--src/detect-virt/detect-virt.c1
-rw-r--r--src/efi-boot-generator/efi-boot-generator.c1
-rw-r--r--src/fsck/fsck.c2
-rw-r--r--src/fstab-generator/fstab-generator.c1
-rw-r--r--src/gpt-auto-generator/gpt-auto-generator.c2
-rw-r--r--src/gudev/gudevclient.c1
-rw-r--r--src/gudev/gudevdevice.c1
-rw-r--r--src/hibernate-resume/hibernate-resume.c2
-rw-r--r--src/hostname/hostnamectl.c7
-rw-r--r--src/hostname/hostnamed.c1
-rw-r--r--src/hwdb/hwdb.c2
-rw-r--r--src/initctl/initctl.c8
-rw-r--r--src/journal-remote/journal-remote-write.h1
-rw-r--r--src/journal-remote/journal-remote.c4
-rw-r--r--src/journal-remote/journal-remote.h1
-rw-r--r--src/journal/cat.c1
-rw-r--r--src/journal/catalog.c1
-rw-r--r--src/journal/compress.c1
-rw-r--r--src/journal/compress.h2
-rw-r--r--src/journal/coredump.c2
-rw-r--r--src/journal/coredumpctl.c1
-rw-r--r--src/journal/fsprg.c1
-rw-r--r--src/journal/journal-authenticate.h1
-rw-r--r--src/journal/journal-file.c1
-rw-r--r--src/journal/journal-qrcode.h2
-rw-r--r--src/journal/journal-vacuum.c3
-rw-r--r--src/journal/journal-vacuum.h1
-rw-r--r--src/journal/journal-verify.c1
-rw-r--r--src/journal/journalctl.c3
-rw-r--r--src/journal/journald-console.c1
-rw-r--r--src/journal/journald-rate-limit.h1
-rw-r--r--src/journal/journald-server.c4
-rw-r--r--src/journal/journald-server.h4
-rw-r--r--src/journal/journald-stream.c1
-rw-r--r--src/journal/journald.c4
-rw-r--r--src/journal/mmap-cache.c1
-rw-r--r--src/journal/mmap-cache.h1
-rw-r--r--src/journal/test-catalog.c1
-rw-r--r--src/journal/test-journal-enum.c1
-rw-r--r--src/journal/test-journal-interleaving.c1
-rw-r--r--src/journal/test-journal-verify.c1
-rw-r--r--src/journal/test-journal.c1
-rw-r--r--src/journal/test-mmap-cache.c1
-rw-r--r--src/libsystemd-network/dhcp-identifier.c2
-rw-r--r--src/libsystemd-network/dhcp-identifier.h1
-rw-r--r--src/libsystemd-network/dhcp-network.c2
-rw-r--r--src/libsystemd-network/dhcp-packet.c8
-rw-r--r--src/libsystemd-network/lldp-network.c1
-rw-r--r--src/libsystemd-network/network-internal.c1
-rw-r--r--src/libsystemd-network/network-internal.h2
-rw-r--r--src/libsystemd-network/sd-dhcp-client.c3
-rw-r--r--src/libsystemd-network/sd-dhcp-lease.c7
-rw-r--r--src/libsystemd-network/sd-dhcp-server.c1
-rw-r--r--src/libsystemd-network/sd-lldp.c3
-rw-r--r--src/libsystemd-network/sd-pppoe.c2
-rw-r--r--src/libsystemd-network/test-dhcp-client.c4
-rw-r--r--src/libsystemd-network/test-dhcp-option.c1
-rw-r--r--src/libsystemd-network/test-dhcp-server.c2
-rw-r--r--src/libsystemd-network/test-lldp.c5
-rw-r--r--src/libsystemd-network/test-pppoe.c6
-rw-r--r--src/libsystemd-terminal/evcat.c5
-rw-r--r--src/libsystemd-terminal/grdev-drm.c1
-rw-r--r--src/libsystemd-terminal/grdev.c3
-rw-r--r--src/libsystemd-terminal/grdev.h2
-rw-r--r--src/libsystemd-terminal/idev-evdev.c4
-rw-r--r--src/libsystemd-terminal/idev-keyboard.c1
-rw-r--r--src/libsystemd-terminal/idev.c5
-rw-r--r--src/libsystemd-terminal/idev.h3
-rw-r--r--src/libsystemd-terminal/modeset.c5
-rw-r--r--src/libsystemd-terminal/subterm.c1
-rw-r--r--src/libsystemd-terminal/sysview.c2
-rw-r--r--src/libsystemd-terminal/sysview.h4
-rw-r--r--src/libsystemd-terminal/term-charset.c3
-rw-r--r--src/libsystemd-terminal/term-page.c1
-rw-r--r--src/libsystemd-terminal/term-wcwidth.c1
-rw-r--r--src/libsystemd-terminal/test-term-page.c4
-rw-r--r--src/libsystemd-terminal/test-term-parser.c4
-rw-r--r--src/libsystemd-terminal/test-unifont.c3
-rw-r--r--src/libsystemd-terminal/unifont.c3
-rw-r--r--src/libsystemd-terminal/unifont.h3
-rw-r--r--src/libsystemd/sd-bus/bus-bloom.h1
-rw-r--r--src/libsystemd/sd-bus/bus-common-errors.h1
-rw-r--r--src/libsystemd/sd-bus/bus-container.c1
-rw-r--r--src/libsystemd/sd-bus/bus-control.c1
-rw-r--r--src/libsystemd/sd-bus/bus-creds.c1
-rw-r--r--src/libsystemd/sd-bus/bus-creds.h1
-rw-r--r--src/libsystemd/sd-bus/bus-dump.c1
-rw-r--r--src/libsystemd/sd-bus/bus-gvariant.c1
-rw-r--r--src/libsystemd/sd-bus/bus-internal.h2
-rw-r--r--src/libsystemd/sd-bus/bus-introspect.c1
-rw-r--r--src/libsystemd/sd-bus/bus-introspect.h1
-rw-r--r--src/libsystemd/sd-bus/bus-kernel.c1
-rw-r--r--src/libsystemd/sd-bus/bus-match.c1
-rw-r--r--src/libsystemd/sd-bus/bus-message.c1
-rw-r--r--src/libsystemd/sd-bus/bus-message.h2
-rw-r--r--src/libsystemd/sd-bus/bus-signature.h1
-rw-r--r--src/libsystemd/sd-bus/bus-socket.c3
-rw-r--r--src/libsystemd/sd-bus/bus-track.c1
-rw-r--r--src/libsystemd/sd-bus/bus-type.c1
-rw-r--r--src/libsystemd/sd-bus/bus-type.h1
-rw-r--r--src/libsystemd/sd-bus/bus-util.h1
-rw-r--r--src/libsystemd/sd-bus/busctl-introspect.h1
-rw-r--r--src/libsystemd/sd-bus/busctl.c2
-rw-r--r--src/libsystemd/sd-bus/sd-bus.c5
-rw-r--r--src/libsystemd/sd-bus/test-bus-chat.c1
-rw-r--r--src/libsystemd/sd-bus/test-bus-creds.c1
-rw-r--r--src/libsystemd/sd-bus/test-bus-introspect.c1
-rw-r--r--src/libsystemd/sd-bus/test-bus-kernel-benchmark.c4
-rw-r--r--src/libsystemd/sd-bus/test-bus-kernel-bloom.c2
-rw-r--r--src/libsystemd/sd-bus/test-bus-kernel.c2
-rw-r--r--src/libsystemd/sd-bus/test-bus-marshal.c2
-rw-r--r--src/libsystemd/sd-bus/test-bus-match.c1
-rw-r--r--src/libsystemd/sd-bus/test-bus-objects.c3
-rw-r--r--src/libsystemd/sd-bus/test-bus-server.c4
-rw-r--r--src/libsystemd/sd-bus/test-bus-signature.c2
-rw-r--r--src/libsystemd/sd-bus/test-bus-zero-copy.c2
-rw-r--r--src/libsystemd/sd-daemon/sd-daemon.c2
-rw-r--r--src/libsystemd/sd-event/sd-event.c1
-rw-r--r--src/libsystemd/sd-hwdb/sd-hwdb.c2
-rw-r--r--src/libsystemd/sd-network/network-util.h1
-rw-r--r--src/libsystemd/sd-network/sd-network.c3
-rw-r--r--src/libsystemd/sd-resolve/sd-resolve.c11
-rw-r--r--src/libsystemd/sd-resolve/test-resolve.c3
-rw-r--r--src/libsystemd/sd-rtnl/local-addresses.h4
-rw-r--r--src/libsystemd/sd-rtnl/rtnl-message.c1
-rw-r--r--src/libsystemd/sd-rtnl/rtnl-types.c2
-rw-r--r--src/libsystemd/sd-rtnl/rtnl-util.c1
-rw-r--r--src/libsystemd/sd-rtnl/rtnl-util.h1
-rw-r--r--src/libsystemd/sd-rtnl/test-rtnl.c1
-rw-r--r--src/libudev/libudev-device-private.c1
-rw-r--r--src/libudev/libudev-enumerate.c2
-rw-r--r--src/libudev/libudev-list.c3
-rw-r--r--src/libudev/libudev-monitor.c4
-rw-r--r--src/libudev/libudev-queue.c5
-rw-r--r--src/libudev/libudev-util.c8
-rw-r--r--src/libudev/libudev.c3
-rw-r--r--src/libudev/libudev.h1
-rw-r--r--src/locale/localectl.c6
-rw-r--r--src/locale/localed.c1
-rw-r--r--src/login/inhibit.c1
-rw-r--r--src/login/loginctl.c1
-rw-r--r--src/login/logind-acl.c1
-rw-r--r--src/login/logind-action.c1
-rw-r--r--src/login/logind-action.h1
-rw-r--r--src/login/logind-button.c3
-rw-r--r--src/login/logind-button.h2
-rw-r--r--src/login/logind-core.c3
-rw-r--r--src/login/logind-dbus.c4
-rw-r--r--src/login/logind-device.c1
-rw-r--r--src/login/logind-device.h2
-rw-r--r--src/login/logind-inhibit.c1
-rw-r--r--src/login/logind-inhibit.h3
-rw-r--r--src/login/logind-seat.c5
-rw-r--r--src/login/logind-seat.h3
-rw-r--r--src/login/logind-session-device.c4
-rw-r--r--src/login/logind-session-device.h4
-rw-r--r--src/login/logind-session.c2
-rw-r--r--src/login/logind-session.h4
-rw-r--r--src/login/logind-user.c1
-rw-r--r--src/login/logind-user.h2
-rw-r--r--src/login/logind.c3
-rw-r--r--src/login/logind.h5
-rw-r--r--src/login/test-inhibit.c1
-rw-r--r--src/login/user-sessions.c1
-rw-r--r--src/machine-id-commit/machine-id-commit.c1
-rw-r--r--src/machine-id-setup/machine-id-setup-main.c1
-rw-r--r--src/machine/image-dbus.c1
-rw-r--r--src/machine/machine-dbus.c1
-rw-r--r--src/machine/machine-dbus.h1
-rw-r--r--src/machine/machine.c1
-rw-r--r--src/machine/machine.h1
-rw-r--r--src/machine/machinectl.c1
-rw-r--r--src/machine/machined-dbus.c9
-rw-r--r--src/machine/machined.c6
-rw-r--r--src/machine/machined.h2
-rw-r--r--src/modules-load/modules-load.c4
-rw-r--r--src/network/networkd-address-pool.c1
-rw-r--r--src/network/networkd-address.c1
-rw-r--r--src/network/networkd-fdb.c5
-rw-r--r--src/network/networkd-link.c3
-rw-r--r--src/network/networkd-manager.c2
-rw-r--r--src/network/networkd-netdev-bond.c1
-rw-r--r--src/network/networkd-netdev-bridge.c4
-rw-r--r--src/network/networkd-netdev-dummy.c5
-rw-r--r--src/network/networkd-netdev-ipvlan.c3
-rw-r--r--src/network/networkd-netdev-macvlan.c2
-rw-r--r--src/network/networkd-netdev-tunnel.c2
-rw-r--r--src/network/networkd-netdev-veth.c2
-rw-r--r--src/network/networkd-netdev-vlan.c2
-rw-r--r--src/network/networkd-netdev-vxlan.c2
-rw-r--r--src/network/networkd-netdev.c1
-rw-r--r--src/network/networkd-netdev.h3
-rw-r--r--src/network/networkd-network-bus.c2
-rw-r--r--src/network/networkd-network.c1
-rw-r--r--src/network/networkd-route.c3
-rw-r--r--src/network/networkd-wait-online-link.c2
-rw-r--r--src/network/networkd-wait-online-manager.c1
-rw-r--r--src/network/networkd-wait-online.h1
-rw-r--r--src/network/networkd.c1
-rw-r--r--src/network/test-network-tables.c1
-rw-r--r--src/notify/notify.c1
-rw-r--r--src/nspawn/nspawn.c9
-rw-r--r--src/nss-myhostname/nss-myhostname.c4
-rw-r--r--src/nss-resolve/nss-resolve.c5
-rw-r--r--src/path/path.c2
-rw-r--r--src/quotacheck/quotacheck.c2
-rw-r--r--src/remount-fs/remount-fs.c2
-rw-r--r--src/reply-password/reply-password.c8
-rw-r--r--src/resolve-host/resolve-host.c2
-rw-r--r--src/resolve/resolved-dns-cache.h1
-rw-r--r--src/resolve/resolved-dns-domain.h1
-rw-r--r--src/resolve/resolved-dns-packet.h1
-rw-r--r--src/resolve/resolved-dns-query.c2
-rw-r--r--src/resolve/resolved-dns-query.h6
-rw-r--r--src/resolve/resolved-dns-rr.h2
-rw-r--r--src/resolve/resolved-dns-scope.h3
-rw-r--r--src/resolve/resolved-dns-server.h1
-rw-r--r--src/resolve/resolved-dns-stream.h1
-rw-r--r--src/resolve/resolved-dns-transaction.h2
-rw-r--r--src/resolve/resolved-link.h2
-rw-r--r--src/resolve/resolved-manager.c5
-rw-r--r--src/resolve/resolved-manager.h4
-rw-r--r--src/resolve/resolved.c1
-rw-r--r--src/resolve/test-dns-domain.c1
-rw-r--r--src/shared/acl-util.c1
-rw-r--r--src/shared/acpi-fpdt.c2
-rw-r--r--src/shared/apparmor-util.c1
-rw-r--r--src/shared/arphrd-list.c1
-rw-r--r--src/shared/ask-password-api.h1
-rw-r--r--src/shared/audit.c7
-rw-r--r--src/shared/audit.h1
-rw-r--r--src/shared/barrier.c3
-rw-r--r--src/shared/barrier.h5
-rw-r--r--src/shared/base-filesystem.c5
-rw-r--r--src/shared/boot-timestamps.c1
-rw-r--r--src/shared/btrfs-util.c1
-rw-r--r--src/shared/bus-label.c3
-rw-r--r--src/shared/cap-list.c1
-rw-r--r--src/shared/capability.c5
-rw-r--r--src/shared/capability.h1
-rw-r--r--src/shared/cgroup-show.h1
-rw-r--r--src/shared/cgroup-util.c2
-rw-r--r--src/shared/clean-ipc.c1
-rw-r--r--src/shared/clock-util.c13
-rw-r--r--src/shared/clock-util.h1
-rw-r--r--src/shared/condition.c2
-rw-r--r--src/shared/conf-files.c3
-rw-r--r--src/shared/conf-files.h1
-rw-r--r--src/shared/conf-parser.c4
-rw-r--r--src/shared/dev-setup.c5
-rw-r--r--src/shared/device-nodes.c3
-rw-r--r--src/shared/efivars.c2
-rw-r--r--src/shared/efivars.h2
-rw-r--r--src/shared/env-util.c1
-rw-r--r--src/shared/env-util.h1
-rw-r--r--src/shared/errno-list.c1
-rw-r--r--src/shared/exit-status.c1
-rw-r--r--src/shared/fdset.c1
-rw-r--r--src/shared/fdset.h1
-rw-r--r--src/shared/fileio-label.c4
-rw-r--r--src/shared/generator.c1
-rw-r--r--src/shared/hashmap.c7
-rw-r--r--src/shared/install-printf.c1
-rw-r--r--src/shared/install.c1
-rw-r--r--src/shared/json.c1
-rw-r--r--src/shared/json.h1
-rw-r--r--src/shared/log.h2
-rw-r--r--src/shared/logs-show.c3
-rw-r--r--src/shared/logs-show.h1
-rw-r--r--src/shared/machine-image.c1
-rw-r--r--src/shared/memfd-util.c2
-rw-r--r--src/shared/memfd-util.h5
-rw-r--r--src/shared/mkdir-label.c6
-rw-r--r--src/shared/mkdir.c5
-rw-r--r--src/shared/mkdir.h1
-rw-r--r--src/shared/pager.c1
-rw-r--r--src/shared/path-lookup.c3
-rw-r--r--src/shared/path-util.c3
-rw-r--r--src/shared/pty.c6
-rw-r--r--src/shared/pty.h5
-rw-r--r--src/shared/ptyfwd.c1
-rw-r--r--src/shared/ptyfwd.h3
-rw-r--r--src/shared/ratelimit.c2
-rw-r--r--src/shared/ring.c1
-rw-r--r--src/shared/ring.h5
-rw-r--r--src/shared/selinux-util.c1
-rw-r--r--src/shared/selinux-util.h1
-rw-r--r--src/shared/socket-label.c8
-rw-r--r--src/shared/socket-util.c7
-rw-r--r--src/shared/socket-util.h1
-rw-r--r--src/shared/spawn-ask-password-agent.c4
-rw-r--r--src/shared/spawn-polkit-agent.c4
-rw-r--r--src/shared/strbuf.h2
-rw-r--r--src/shared/strv.c1
-rw-r--r--src/shared/strxcpyx.h2
-rw-r--r--src/shared/time-dst.c6
-rw-r--r--src/shared/unit-name.c1
-rw-r--r--src/shared/util.c3
-rw-r--r--src/shared/util.h3
-rw-r--r--src/shared/utmp-wtmp.c1
-rw-r--r--src/shutdownd/shutdownd.c4
-rw-r--r--src/sleep/sleep.c2
-rw-r--r--src/socket-proxy/socket-proxyd.c2
-rw-r--r--src/system-update-generator/system-update-generator.c2
-rw-r--r--src/systemctl/systemctl.c6
-rw-r--r--src/sysusers/sysusers.c2
-rw-r--r--src/sysv-generator/sysv-generator.c4
-rw-r--r--src/test/test-barrier.c3
-rw-r--r--src/test/test-btrfs.c1
-rw-r--r--src/test/test-cap-list.c1
-rw-r--r--src/test/test-capability.c1
-rw-r--r--src/test/test-cgroup-mask.c5
-rw-r--r--src/test/test-cgroup-util.c1
-rw-r--r--src/test/test-cgroup.c1
-rw-r--r--src/test/test-ellipsize.c1
-rw-r--r--src/test/test-engine.c1
-rw-r--r--src/test/test-env-replace.c1
-rw-r--r--src/test/test-execute.c1
-rw-r--r--src/test/test-hashmap.c2
-rw-r--r--src/test/test-hostname.c4
-rw-r--r--src/test/test-install.c4
-rw-r--r--src/test/test-job-type.c3
-rw-r--r--src/test/test-json.c1
-rw-r--r--src/test/test-libudev.c5
-rw-r--r--src/test/test-locale-util.c1
-rw-r--r--src/test/test-loopback.c3
-rw-r--r--src/test/test-ns.c4
-rw-r--r--src/test/test-path-lookup.c1
-rw-r--r--src/test/test-pty.c2
-rw-r--r--src/test/test-ring.c5
-rw-r--r--src/test/test-rtnl-manual.c5
-rw-r--r--src/test/test-set.c1
-rw-r--r--src/test/test-sleep.c3
-rw-r--r--src/test/test-strxcpyx.c1
-rw-r--r--src/test/test-tables.c2
-rw-r--r--src/test/test-tmpfiles.c2
-rw-r--r--src/test/test-udev.c5
-rw-r--r--src/test/test-unit-file.c1
-rw-r--r--src/test/test-unit-name.c2
-rw-r--r--src/test/test-watchdog.c1
-rw-r--r--src/timedate/timedatectl.c3
-rw-r--r--src/timedate/timedated.c3
-rw-r--r--src/timesync/timesyncd-conf.c1
-rw-r--r--src/timesync/timesyncd-manager.c11
-rw-r--r--src/timesync/timesyncd-manager.h1
-rw-r--r--src/timesync/timesyncd.c1
-rw-r--r--src/tmpfiles/tmpfiles.c4
-rw-r--r--src/udev/accelerometer/accelerometer.c6
-rw-r--r--src/udev/collect/collect.c8
-rw-r--r--src/udev/net/link-config.c4
-rw-r--r--src/udev/net/link-config.h1
-rw-r--r--src/udev/udev-builtin-blkid.c2
-rw-r--r--src/udev/udev-builtin-btrfs.c4
-rw-r--r--src/udev/udev-builtin-hwdb.c4
-rw-r--r--src/udev/udev-builtin-keyboard.c4
-rw-r--r--src/udev/udev-builtin-kmod.c5
-rw-r--r--src/udev/udev-builtin-uaccess.c7
-rw-r--r--src/udev/udev-builtin.c4
-rw-r--r--src/udev/udev-ctrl.c2
-rw-r--r--src/udev/udev-event.c1
-rw-r--r--src/udev/udev-node.c4
-rw-r--r--src/udev/udev-watch.c4
-rw-r--r--src/udev/udevadm-control.c5
-rw-r--r--src/udev/udevadm-hwdb.c1
-rw-r--r--src/udev/udevadm-info.c3
-rw-r--r--src/udev/udevadm-monitor.c7
-rw-r--r--src/udev/udevadm-settle.c7
-rw-r--r--src/udev/udevadm-test-builtin.c10
-rw-r--r--src/udev/udevadm-test.c3
-rw-r--r--src/udev/udevadm-trigger.c7
-rw-r--r--src/udev/udevadm.c3
-rw-r--r--src/udev/udevd.c6
-rw-r--r--src/update-done/update-done.c1
-rw-r--r--src/update-utmp/update-utmp.c2
-rw-r--r--src/vconsole/vconsole-setup.c5
479 files changed, 11 insertions, 1286 deletions
diff --git a/src/activate/activate.c b/src/activate/activate.c
index 2689934c4..d345e2856 100644
--- a/src/activate/activate.c
+++ b/src/activate/activate.c
@@ -20,7 +20,6 @@
***/
#include <unistd.h>
-#include <fcntl.h>
#include <sys/epoll.h>
#include <sys/prctl.h>
#include <sys/socket.h>
diff --git a/src/analyze/analyze-verify.c b/src/analyze/analyze-verify.c
index f56910926..bfc71e3f3 100644
--- a/src/analyze/analyze-verify.c
+++ b/src/analyze/analyze-verify.c
@@ -20,13 +20,11 @@
***/
#include <stdlib.h>
-#include <getopt.h>
#include "manager.h"
#include "bus-util.h"
#include "log.h"
#include "strv.h"
-#include "build.h"
#include "pager.h"
#include "analyze-verify.h"
diff --git a/src/analyze/analyze.c b/src/analyze/analyze.c
index 591b4ab14..7abe969be 100644
--- a/src/analyze/analyze.c
+++ b/src/analyze/analyze.c
@@ -24,17 +24,14 @@
#include <stdlib.h>
#include <getopt.h>
#include <locale.h>
-#include <sys/utsname.h>
#include "sd-bus.h"
#include "bus-util.h"
#include "bus-error.h"
-#include "install.h"
#include "log.h"
#include "build.h"
#include "util.h"
#include "strxcpyx.h"
-#include "fileio.h"
#include "strv.h"
#include "unit-name.h"
#include "special.h"
diff --git a/src/ask-password/ask-password.c b/src/ask-password/ask-password.c
index ad8ad659d..2cbed293b 100644
--- a/src/ask-password/ask-password.c
+++ b/src/ask-password/ask-password.c
@@ -19,25 +19,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/socket.h>
-#include <poll.h>
-#include <sys/types.h>
-#include <assert.h>
-#include <string.h>
#include <errno.h>
#include <unistd.h>
-#include <fcntl.h>
-#include <sys/un.h>
-#include <sys/stat.h>
-#include <sys/signalfd.h>
#include <getopt.h>
-#include <termios.h>
-#include <limits.h>
#include <stddef.h>
#include "log.h"
#include "macro.h"
-#include "util.h"
#include "strv.h"
#include "ask-password-api.h"
#include "def.h"
diff --git a/src/binfmt/binfmt.c b/src/binfmt/binfmt.c
index 089b7754a..6028ed68c 100644
--- a/src/binfmt/binfmt.c
+++ b/src/binfmt/binfmt.c
@@ -25,11 +25,9 @@
#include <string.h>
#include <stdio.h>
#include <limits.h>
-#include <stdarg.h>
#include <getopt.h>
#include "log.h"
-#include "hashmap.h"
#include "strv.h"
#include "util.h"
#include "conf-files.h"
diff --git a/src/boot/bootctl.c b/src/boot/bootctl.c
index 73450e283..96637f12c 100644
--- a/src/boot/bootctl.c
+++ b/src/boot/bootctl.c
@@ -41,7 +41,6 @@
#include "efivars.h"
#include "build.h"
#include "util.h"
-#include "utf8.h"
static int verify_esp(const char *p, uint32_t *part, uint64_t *pstart, uint64_t *psize, sd_id128_t *uuid) {
struct statfs sfs;
diff --git a/src/bootchart/bootchart.c b/src/bootchart/bootchart.c
index 64a384bac..2fac30039 100644
--- a/src/bootchart/bootchart.c
+++ b/src/bootchart/bootchart.c
@@ -33,10 +33,7 @@
***/
-#include <sys/time.h>
-#include <sys/types.h>
#include <sys/resource.h>
-#include <sys/stat.h>
#include <stdio.h>
#include <signal.h>
#include <stdlib.h>
diff --git a/src/bootchart/bootchart.h b/src/bootchart/bootchart.h
index 26de0dd9f..e4dbdd921 100644
--- a/src/bootchart/bootchart.h
+++ b/src/bootchart/bootchart.h
@@ -24,7 +24,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <dirent.h>
#include <stdbool.h>
#include "list.h"
diff --git a/src/bootchart/store.c b/src/bootchart/store.c
index a66387c30..607cc5e74 100644
--- a/src/bootchart/store.c
+++ b/src/bootchart/store.c
@@ -25,8 +25,6 @@
#include <unistd.h>
#include <stdlib.h>
#include <limits.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <stdio.h>
#include <string.h>
#include <dirent.h>
diff --git a/src/bootchart/svg.c b/src/bootchart/svg.c
index e111fa9cc..93b4764ee 100644
--- a/src/bootchart/svg.c
+++ b/src/bootchart/svg.c
@@ -23,14 +23,11 @@
***/
#include <stdio.h>
-#include <stdarg.h>
-#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <limits.h>
#include <unistd.h>
#include <sys/utsname.h>
-#include <sys/stat.h>
#include <fcntl.h>
#include "util.h"
diff --git a/src/bus-proxyd/bus-proxyd.c b/src/bus-proxyd/bus-proxyd.c
index b6b005636..9645c504f 100644
--- a/src/bus-proxyd/bus-proxyd.c
+++ b/src/bus-proxyd/bus-proxyd.c
@@ -23,13 +23,9 @@
***/
#include <sys/socket.h>
-#include <sys/un.h>
-#include <sys/types.h>
-#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
-#include <poll.h>
#include <sys/prctl.h>
#include <stddef.h>
#include <getopt.h>
@@ -37,24 +33,14 @@
#include "log.h"
#include "util.h"
-#include "hashmap.h"
-#include "socket-util.h"
#include "sd-daemon.h"
-#include "sd-bus.h"
#include "bus-internal.h"
-#include "bus-message.h"
-#include "bus-util.h"
#include "build.h"
#include "strv.h"
#include "def.h"
#include "capability.h"
-#include "bus-control.h"
-#include "smack-util.h"
-#include "set.h"
#include "bus-xml-policy.h"
-#include "driver.h"
#include "proxy.h"
-#include "synthesize.h"
static char *arg_address = NULL;
static char **arg_configuration = NULL;
diff --git a/src/bus-proxyd/bus-xml-policy.c b/src/bus-proxyd/bus-xml-policy.c
index f6ac0c009..497bce7b5 100644
--- a/src/bus-proxyd/bus-xml-policy.c
+++ b/src/bus-proxyd/bus-xml-policy.c
@@ -25,7 +25,6 @@
#include "set.h"
#include "conf-files.h"
#include "bus-internal.h"
-#include "bus-message.h"
#include "bus-xml-policy.h"
#include "sd-login.h"
diff --git a/src/bus-proxyd/bus-xml-policy.h b/src/bus-proxyd/bus-xml-policy.h
index f2ec1bbea..8f0ab8f17 100644
--- a/src/bus-proxyd/bus-xml-policy.h
+++ b/src/bus-proxyd/bus-xml-policy.h
@@ -21,12 +21,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <inttypes.h>
#include <pthread.h>
#include "list.h"
#include "hashmap.h"
-#include "set.h"
typedef enum PolicyItemType {
_POLICY_ITEM_TYPE_UNSET = 0,
diff --git a/src/bus-proxyd/driver.c b/src/bus-proxyd/driver.c
index bc2c0c86f..3c613e415 100644
--- a/src/bus-proxyd/driver.c
+++ b/src/bus-proxyd/driver.c
@@ -21,23 +21,16 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
-#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <stddef.h>
-#include "log.h"
#include "util.h"
#include "sd-bus.h"
#include "bus-internal.h"
#include "bus-message.h"
#include "bus-util.h"
-#include "build.h"
#include "strv.h"
-#include "def.h"
-#include "capability.h"
-#include "bus-control.h"
#include "set.h"
#include "driver.h"
#include "synthesize.h"
diff --git a/src/bus-proxyd/proxy.c b/src/bus-proxyd/proxy.c
index 3dea908f5..0c851f93c 100644
--- a/src/bus-proxyd/proxy.c
+++ b/src/bus-proxyd/proxy.c
@@ -23,30 +23,20 @@
***/
#include <sys/socket.h>
-#include <sys/un.h>
#include <sys/types.h>
-#include <fcntl.h>
-#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <poll.h>
-#include <stddef.h>
-#include <getopt.h>
#include "log.h"
#include "util.h"
-#include "socket-util.h"
#include "sd-daemon.h"
#include "sd-bus.h"
#include "bus-internal.h"
#include "bus-message.h"
#include "bus-util.h"
-#include "build.h"
#include "strv.h"
-#include "def.h"
-#include "capability.h"
#include "bus-control.h"
-#include "smack-util.h"
#include "set.h"
#include "bus-xml-policy.h"
#include "driver.h"
diff --git a/src/bus-proxyd/proxy.h b/src/bus-proxyd/proxy.h
index 913d47071..172bc7f56 100644
--- a/src/bus-proxyd/proxy.h
+++ b/src/bus-proxyd/proxy.h
@@ -21,10 +21,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdlib.h>
#include "sd-bus.h"
#include "bus-xml-policy.h"
-#include "util.h"
typedef struct Proxy Proxy;
diff --git a/src/bus-proxyd/stdio-bridge.c b/src/bus-proxyd/stdio-bridge.c
index 9fb3e9fc4..35e69a5c0 100644
--- a/src/bus-proxyd/stdio-bridge.c
+++ b/src/bus-proxyd/stdio-bridge.c
@@ -21,36 +21,22 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <sys/types.h>
-#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <errno.h>
-#include <poll.h>
#include <stddef.h>
#include <getopt.h>
#include "log.h"
#include "util.h"
-#include "socket-util.h"
#include "sd-daemon.h"
#include "sd-bus.h"
#include "bus-internal.h"
-#include "bus-message.h"
#include "bus-util.h"
#include "build.h"
#include "strv.h"
#include "def.h"
-#include "capability.h"
-#include "bus-control.h"
-#include "smack-util.h"
-#include "set.h"
-#include "bus-xml-policy.h"
-#include "driver.h"
#include "proxy.h"
-#include "synthesize.h"
static char *arg_address = NULL;
static char *arg_command_line_buffer = NULL;
diff --git a/src/bus-proxyd/synthesize.c b/src/bus-proxyd/synthesize.c
index e1b0fd353..542166f68 100644
--- a/src/bus-proxyd/synthesize.c
+++ b/src/bus-proxyd/synthesize.c
@@ -21,21 +21,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
-#include <unistd.h>
-#include <string.h>
-#include <errno.h>
#include <stddef.h>
-#include "log.h"
#include "util.h"
#include "sd-bus.h"
#include "bus-internal.h"
#include "bus-message.h"
#include "bus-util.h"
-#include "strv.h"
-#include "def.h"
-#include "bus-control.h"
#include "synthesize.h"
static int synthetic_driver_send(sd_bus *b, sd_bus_message *m) {
diff --git a/src/bus-proxyd/test-bus-xml-policy.c b/src/bus-proxyd/test-bus-xml-policy.c
index 421487e03..d19d0e1b6 100644
--- a/src/bus-proxyd/test-bus-xml-policy.c
+++ b/src/bus-proxyd/test-bus-xml-policy.c
@@ -19,27 +19,14 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/socket.h>
-#include <sys/un.h>
-#include <sys/types.h>
-#include <fcntl.h>
#include <unistd.h>
-#include <string.h>
#include <errno.h>
-#include <poll.h>
#include <stddef.h>
-#include <getopt.h>
#include "log.h"
#include "util.h"
#include "sd-bus.h"
-#include "bus-internal.h"
-#include "bus-message.h"
-#include "bus-util.h"
-#include "build.h"
#include "strv.h"
-#include "def.h"
-#include "capability.h"
#include "bus-xml-policy.h"
static int test_policy_load(Policy *p, const char *name) {
diff --git a/src/cgls/cgls.c b/src/cgls/cgls.c
index 579e06de5..c6f548571 100644
--- a/src/cgls/cgls.c
+++ b/src/cgls/cgls.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <limits.h>
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
diff --git a/src/console/consoled-display.c b/src/console/consoled-display.c
index a30a2f102..569c011dc 100644
--- a/src/console/consoled-display.c
+++ b/src/console/consoled-display.c
@@ -20,7 +20,6 @@
***/
#include <errno.h>
-#include <inttypes.h>
#include <stdlib.h>
#include "consoled.h"
#include "grdev.h"
diff --git a/src/console/consoled-manager.c b/src/console/consoled-manager.c
index 9dd62f04a..f82f211d4 100644
--- a/src/console/consoled-manager.c
+++ b/src/console/consoled-manager.c
@@ -20,15 +20,12 @@
***/
#include <errno.h>
-#include <libudev.h>
#include <stdlib.h>
-#include <string.h>
#include "consoled.h"
#include "grdev.h"
#include "idev.h"
#include "log.h"
#include "sd-bus.h"
-#include "sd-daemon.h"
#include "sd-event.h"
#include "sd-login.h"
#include "sysview.h"
diff --git a/src/console/consoled-session.c b/src/console/consoled-session.c
index 927965e02..264a4d009 100644
--- a/src/console/consoled-session.c
+++ b/src/console/consoled-session.c
@@ -20,16 +20,12 @@
***/
#include <errno.h>
-#include <inttypes.h>
-#include <libudev.h>
#include <stdlib.h>
#include "consoled.h"
#include "grdev.h"
-#include "hashmap.h"
#include "idev.h"
#include "list.h"
#include "macro.h"
-#include "sd-bus.h"
#include "sd-event.h"
#include "sysview.h"
#include "util.h"
diff --git a/src/console/consoled-terminal.c b/src/console/consoled-terminal.c
index 19d14016a..3657dca39 100644
--- a/src/console/consoled-terminal.c
+++ b/src/console/consoled-terminal.c
@@ -20,7 +20,6 @@
***/
#include <errno.h>
-#include <inttypes.h>
#include <stdlib.h>
#include "consoled.h"
#include "list.h"
diff --git a/src/console/consoled-workspace.c b/src/console/consoled-workspace.c
index 56344ef2c..5e9e5c7c4 100644
--- a/src/console/consoled-workspace.c
+++ b/src/console/consoled-workspace.c
@@ -20,7 +20,6 @@
***/
#include <errno.h>
-#include <inttypes.h>
#include <stdlib.h>
#include "consoled.h"
#include "grdev.h"
diff --git a/src/console/consoled.c b/src/console/consoled.c
index 6f65dcdcb..26dd068f5 100644
--- a/src/console/consoled.c
+++ b/src/console/consoled.c
@@ -21,11 +21,9 @@
#include <errno.h>
#include <stdlib.h>
-#include <string.h>
#include "consoled.h"
#include "log.h"
#include "sd-daemon.h"
-#include "util.h"
int main(int argc, char *argv[]) {
_cleanup_(manager_freep) Manager *m = NULL;
diff --git a/src/console/consoled.h b/src/console/consoled.h
index b0db61040..f85c1a079 100644
--- a/src/console/consoled.h
+++ b/src/console/consoled.h
@@ -21,10 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <errno.h>
-#include <inttypes.h>
-#include <libudev.h>
-#include <stdlib.h>
#include "grdev.h"
#include "idev.h"
#include "list.h"
diff --git a/src/core/automount.c b/src/core/automount.c
index 9f6bd84b2..4a509efaf 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 775822d8d..69528a2ae 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 8fa851de3..993aa9db7 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 b2a510ad0..38acbd0c2 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 1bec95378..a2b124d75 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 28f192403..b1ceb05b1 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 b5eed37d5..ea55b6c8c 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 f556536f3..cb156fd37 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 4aff226ab..10e945e40 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 e1903fa16..3730deb57 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 53fe4edc3..24813c6d2 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 b5e894101..683561999 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 667da0522..389b0d7f9 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 6d4713bab..e1f3d5649 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 8bc90b1da..09e78d1f3 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 a1959defc..0be46c288 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 50b167442..02599a9e5 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 1e7f66d05..009337130 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 205d1c4a8..350f5c3ed 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 6be9c9f70..4c4297bc9 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 43e785246..74a991435 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 fba3f7cc7..0ff9a01e1 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 e7cf93dc6..5dcb0d1c9 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 d3deac393..2d983cc56 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 bb7ae0783..906508530 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 1815e3de2..39ec5adbb 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 6e0c9faa7..1a43ac77b 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 ce522a4e4..ffeb5cd31 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 6664e8952..03b0ce3b4 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 0e0d16a7c..7721b3eca 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 4740ff18c..db7ebae6b 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 d967b68a3..9119e4834 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 427134651..60a510eae 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 5a50ae6f0..c6f1ddfec 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 c0a05b97a..efbdf3168 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 8be190040..11566af51 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 90bf5634c..6d0192fc7 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 e993c5732..108072ca9 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 67ce160c1..63b15c120 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 d00a53246..063f705ed 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 08f46f569..d68e73769 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 4775219e4..79a9d5495 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 d3971f168..4e33ba63f 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 521545e5c..343ff066a 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 f3977e62d..40037e786 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 d6987e6fa..76771ab7a 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 4fecd3236..6a6d11931 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 e5ea79fec..fbb695d87 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 0d36aab96..dec39333e 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 b41db7872..a0e473253 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 6c5912642..4452fe2c9 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 18888747f..a8c9a4b88 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 dd1e8bb9d..b5758e2e4 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 fba915d7d..a4678500e 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 15e29be14..c7b35050b 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 dfeee6a68..fe5afef46 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 71f001ac1..70a461e38 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 ae9819d01..4d2eaf7ed 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 ad0c63902..ac648e56f 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 59f6832bc..ff2a02004 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 e6dc66106..f2451b119 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 88aae4815..7d052f2ef 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 a2e08998c..5acf214e1 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 6997921fd..f73a8e6de 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 73e64d87a..c36c6f2ce 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 33fb66bc3..8817ef21c 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 a5398d9e9..0a25ef469 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 45744c7de..940550194 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 de412a043..9d919e4d3 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 b0b3d6bd6..64c2af5a1 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 dd7df194d..ceee70fbe 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 97135db55..7736899a3 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 ee8e607c2..ad5348b57 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 291bc77a7..b3775d4d8 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"
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
index 05061c070..5a0611afb 100644
--- a/src/cryptsetup/cryptsetup-generator.c
+++ b/src/cryptsetup/cryptsetup-generator.c
@@ -20,11 +20,8 @@
***/
#include <errno.h>
-#include <string.h>
-#include <unistd.h>
#include "dropin.h"
-#include "fileio.h"
#include "generator.h"
#include "hashmap.h"
#include "log.h"
diff --git a/src/cryptsetup/cryptsetup.c b/src/cryptsetup/cryptsetup.c
index 3f613d9b6..9e0fef7c6 100644
--- a/src/cryptsetup/cryptsetup.c
+++ b/src/cryptsetup/cryptsetup.c
@@ -32,7 +32,6 @@
#include "path-util.h"
#include "strv.h"
#include "ask-password-api.h"
-#include "def.h"
#include "libudev.h"
#include "udev-util.h"
diff --git a/src/delta/delta.c b/src/delta/delta.c
index de963f700..9f1f8f333 100644
--- a/src/delta/delta.c
+++ b/src/delta/delta.c
@@ -21,7 +21,6 @@
***/
#include <errno.h>
-#include <assert.h>
#include <string.h>
#include <unistd.h>
#include <getopt.h>
diff --git a/src/detect-virt/detect-virt.c b/src/detect-virt/detect-virt.c
index 9a924117d..606d073cb 100644
--- a/src/detect-virt/detect-virt.c
+++ b/src/detect-virt/detect-virt.c
@@ -22,7 +22,6 @@
#include <stdlib.h>
#include <stdbool.h>
#include <errno.h>
-#include <string.h>
#include <getopt.h>
#include "util.h"
diff --git a/src/efi-boot-generator/efi-boot-generator.c b/src/efi-boot-generator/efi-boot-generator.c
index b3ff3a8b7..58c4cc278 100644
--- a/src/efi-boot-generator/efi-boot-generator.c
+++ b/src/efi-boot-generator/efi-boot-generator.c
@@ -26,7 +26,6 @@
#include "path-util.h"
#include "util.h"
#include "mkdir.h"
-#include "unit-name.h"
#include "virt.h"
#include "generator.h"
#include "special.h"
diff --git a/src/fsck/fsck.c b/src/fsck/fsck.c
index e7185342d..cf4d37571 100644
--- a/src/fsck/fsck.c
+++ b/src/fsck/fsck.c
@@ -22,7 +22,6 @@
#include <stdio.h>
#include <stdbool.h>
-#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
@@ -37,7 +36,6 @@
#include "bus-util.h"
#include "bus-error.h"
#include "bus-common-errors.h"
-#include "fileio.h"
#include "udev-util.h"
#include "path-util.h"
#include "socket-util.h"
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index 5662b5fde..ccc7c6e26 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -33,7 +33,6 @@
#include "mount-setup.h"
#include "special.h"
#include "mkdir.h"
-#include "fileio.h"
#include "generator.h"
#include "strv.h"
#include "virt.h"
diff --git a/src/gpt-auto-generator/gpt-auto-generator.c b/src/gpt-auto-generator/gpt-auto-generator.c
index 5c58b58f8..07ee2cc79 100644
--- a/src/gpt-auto-generator/gpt-auto-generator.c
+++ b/src/gpt-auto-generator/gpt-auto-generator.c
@@ -21,8 +21,6 @@
#include <unistd.h>
#include <stdlib.h>
-#include <fcntl.h>
-#include <sys/ioctl.h>
#include <sys/statfs.h>
#include <blkid/blkid.h>
diff --git a/src/gudev/gudevclient.c b/src/gudev/gudevclient.c
index 1eec75893..8b9516cba 100644
--- a/src/gudev/gudevclient.c
+++ b/src/gudev/gudevclient.c
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <string.h>
+#include <sys/stat.h>
#include "gudevclient.h"
#include "gudevdevice.h"
diff --git a/src/gudev/gudevdevice.c b/src/gudev/gudevdevice.c
index 710671911..5530d2c42 100644
--- a/src/gudev/gudevdevice.c
+++ b/src/gudev/gudevdevice.c
@@ -23,6 +23,7 @@
#include <stdlib.h>
#include <string.h>
+#include <sys/stat.h>
#include "gudevdevice.h"
#include "gudevprivate.h"
diff --git a/src/hibernate-resume/hibernate-resume.c b/src/hibernate-resume/hibernate-resume.c
index f28eabbe3..43aac616b 100644
--- a/src/hibernate-resume/hibernate-resume.c
+++ b/src/hibernate-resume/hibernate-resume.c
@@ -21,9 +21,7 @@
#include <stdio.h>
#include <errno.h>
-#include <sys/types.h>
#include <sys/stat.h>
-#include <unistd.h>
#include "log.h"
#include "util.h"
diff --git a/src/hostname/hostnamectl.c b/src/hostname/hostnamectl.c
index de4ce7ede..5218b41b4 100644
--- a/src/hostname/hostnamectl.c
+++ b/src/hostname/hostnamectl.c
@@ -21,12 +21,9 @@
#include <stdlib.h>
#include <stdbool.h>
-#include <unistd.h>
#include <getopt.h>
#include <locale.h>
#include <string.h>
-#include <sys/timex.h>
-#include <sys/utsname.h>
#include "sd-bus.h"
@@ -35,12 +32,8 @@
#include "util.h"
#include "spawn-polkit-agent.h"
#include "build.h"
-#include "clock-util.h"
-#include "strv.h"
#include "sd-id128.h"
-#include "virt.h"
#include "architecture.h"
-#include "fileio.h"
static bool arg_ask_password = true;
static BusTransport arg_transport = BUS_TRANSPORT_LOCAL;
diff --git a/src/hostname/hostnamed.c b/src/hostname/hostnamed.c
index ede818578..77b776fea 100644
--- a/src/hostname/hostnamed.c
+++ b/src/hostname/hostnamed.c
@@ -30,7 +30,6 @@
#include "virt.h"
#include "env-util.h"
#include "fileio-label.h"
-#include "label.h"
#include "bus-util.h"
#include "event-util.h"
#include "selinux-util.h"
diff --git a/src/hwdb/hwdb.c b/src/hwdb/hwdb.c
index 4539673ea..446de3a2f 100644
--- a/src/hwdb/hwdb.c
+++ b/src/hwdb/hwdb.c
@@ -18,7 +18,6 @@
***/
#include <stdlib.h>
-#include <unistd.h>
#include <getopt.h>
#include <string.h>
#include <ctype.h>
@@ -28,7 +27,6 @@
#include "conf-files.h"
#include "strv.h"
#include "mkdir.h"
-#include "fileio.h"
#include "verbs.h"
#include "build.h"
diff --git a/src/initctl/initctl.c b/src/initctl/initctl.c
index 8b632e88a..ecec7a16a 100644
--- a/src/initctl/initctl.c
+++ b/src/initctl/initctl.c
@@ -19,18 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/socket.h>
-#include <sys/types.h>
-#include <assert.h>
-#include <time.h>
-#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <unistd.h>
-#include <poll.h>
#include <sys/epoll.h>
-#include <sys/un.h>
-#include <fcntl.h>
#include <ctype.h>
#include "sd-daemon.h"
diff --git a/src/journal-remote/journal-remote-write.h b/src/journal-remote/journal-remote-write.h
index aa381c661..7f47f8b01 100644
--- a/src/journal-remote/journal-remote-write.h
+++ b/src/journal-remote/journal-remote-write.h
@@ -21,7 +21,6 @@
#pragma once
-#include <stdlib.h>
#include "journal-file.h"
diff --git a/src/journal-remote/journal-remote.c b/src/journal-remote/journal-remote.c
index 8f32a9a98..ba811e033 100644
--- a/src/journal-remote/journal-remote.c
+++ b/src/journal-remote/journal-remote.c
@@ -26,8 +26,6 @@
#include <string.h>
#include <sys/prctl.h>
#include <sys/socket.h>
-#include <sys/stat.h>
-#include <sys/types.h>
#include <unistd.h>
#include <getopt.h>
@@ -35,13 +33,11 @@
#include "journal-file.h"
#include "journald-native.h"
#include "socket-util.h"
-#include "mkdir.h"
#include "build.h"
#include "macro.h"
#include "strv.h"
#include "fileio.h"
#include "conf-parser.h"
-#include "siphash24.h"
#ifdef HAVE_GNUTLS
#include <gnutls/gnutls.h>
diff --git a/src/journal-remote/journal-remote.h b/src/journal-remote/journal-remote.h
index 1cf22f638..6c2ccb973 100644
--- a/src/journal-remote/journal-remote.h
+++ b/src/journal-remote/journal-remote.h
@@ -21,7 +21,6 @@
#pragma once
-#include <inttypes.h>
#include "sd-event.h"
#include "hashmap.h"
diff --git a/src/journal/cat.c b/src/journal/cat.c
index 79706b692..2e236f000 100644
--- a/src/journal/cat.c
+++ b/src/journal/cat.c
@@ -21,7 +21,6 @@
#include <stdio.h>
#include <getopt.h>
-#include <assert.h>
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
diff --git a/src/journal/catalog.c b/src/journal/catalog.c
index f17023284..e505a0530 100644
--- a/src/journal/catalog.c
+++ b/src/journal/catalog.c
@@ -34,7 +34,6 @@
#include "hashmap.h"
#include "strv.h"
#include "strbuf.h"
-#include "strxcpyx.h"
#include "conf-files.h"
#include "mkdir.h"
#include "catalog.h"
diff --git a/src/journal/compress.c b/src/journal/compress.c
index 6923753f8..4232206f4 100644
--- a/src/journal/compress.c
+++ b/src/journal/compress.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
diff --git a/src/journal/compress.h b/src/journal/compress.h
index 136dda6d3..6294f16fa 100644
--- a/src/journal/compress.h
+++ b/src/journal/compress.h
@@ -21,8 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <inttypes.h>
-#include <stdbool.h>
#include <unistd.h>
#include "journal-def.h"
diff --git a/src/journal/coredump.c b/src/journal/coredump.c
index f7ba0191e..6357d3e27 100644
--- a/src/journal/coredump.c
+++ b/src/journal/coredump.c
@@ -23,7 +23,6 @@
#include <unistd.h>
#include <stdio.h>
#include <sys/prctl.h>
-#include <sys/types.h>
#include <sys/xattr.h>
#ifdef HAVE_ELFUTILS
@@ -44,7 +43,6 @@
#include "conf-parser.h"
#include "copy.h"
#include "stacktrace.h"
-#include "path-util.h"
#include "compress.h"
#include "acl-util.h"
#include "capability.h"
diff --git a/src/journal/coredumpctl.c b/src/journal/coredumpctl.c
index afb39ad03..62983a73e 100644
--- a/src/journal/coredumpctl.c
+++ b/src/journal/coredumpctl.c
@@ -35,7 +35,6 @@
#include "pager.h"
#include "macro.h"
#include "journal-internal.h"
-#include "copy.h"
#include "compress.h"
#include "sigbus.h"
diff --git a/src/journal/fsprg.c b/src/journal/fsprg.c
index 5c8d6d6fe..a9f564c24 100644
--- a/src/journal/fsprg.c
+++ b/src/journal/fsprg.c
@@ -30,7 +30,6 @@
#include <gcrypt.h>
#include <string.h>
-#include <assert.h>
#include "fsprg.h"
diff --git a/src/journal/journal-authenticate.h b/src/journal/journal-authenticate.h
index 565fe8432..118bb1367 100644
--- a/src/journal/journal-authenticate.h
+++ b/src/journal/journal-authenticate.h
@@ -22,7 +22,6 @@
***/
#include <stdbool.h>
-#include <inttypes.h>
#include "journal-file.h"
diff --git a/src/journal/journal-file.c b/src/journal/journal-file.c
index 2845e05ce..9b4967fb3 100644
--- a/src/journal/journal-file.c
+++ b/src/journal/journal-file.c
@@ -34,7 +34,6 @@
#include "journal-authenticate.h"
#include "lookup3.h"
#include "compress.h"
-#include "fsprg.h"
#define DEFAULT_DATA_HASH_TABLE_SIZE (2047ULL*sizeof(HashItem))
#define DEFAULT_FIELD_HASH_TABLE_SIZE (333ULL*sizeof(HashItem))
diff --git a/src/journal/journal-qrcode.h b/src/journal/journal-qrcode.h
index c527e6555..3ff6a3ad4 100644
--- a/src/journal/journal-qrcode.h
+++ b/src/journal/journal-qrcode.h
@@ -21,8 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <inttypes.h>
-#include <sys/types.h>
#include <stdio.h>
#include "systemd/sd-id128.h"
diff --git a/src/journal/journal-vacuum.c b/src/journal/journal-vacuum.c
index 832c327b3..a367dc1bb 100644
--- a/src/journal/journal-vacuum.c
+++ b/src/journal/journal-vacuum.c
@@ -19,12 +19,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
#include <fcntl.h>
#include <sys/stat.h>
-#include <sys/statvfs.h>
#include <unistd.h>
-#include <sys/xattr.h>
#include "journal-def.h"
#include "journal-file.h"
diff --git a/src/journal/journal-vacuum.h b/src/journal/journal-vacuum.h
index a7fb6f0f0..c45cc31d0 100644
--- a/src/journal/journal-vacuum.h
+++ b/src/journal/journal-vacuum.h
@@ -21,6 +21,5 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <inttypes.h>
int journal_directory_vacuum(const char *directory, uint64_t max_use, usec_t max_retention_usec, usec_t *oldest_usec, bool vacuum);
diff --git a/src/journal/journal-verify.c b/src/journal/journal-verify.c
index b03335ef3..35c270cb3 100644
--- a/src/journal/journal-verify.c
+++ b/src/journal/journal-verify.c
@@ -32,7 +32,6 @@
#include "journal-verify.h"
#include "lookup3.h"
#include "compress.h"
-#include "fsprg.h"
static void draw_progress(uint64_t p, usec_t *last_usec) {
unsigned n, i, j, k;
diff --git a/src/journal/journalctl.c b/src/journal/journalctl.c
index 55c778633..56435ff7b 100644
--- a/src/journal/journalctl.c
+++ b/src/journal/journalctl.c
@@ -28,12 +28,10 @@
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
-#include <time.h>
#include <getopt.h>
#include <signal.h>
#include <poll.h>
#include <sys/stat.h>
-#include <sys/ioctl.h>
#include <sys/inotify.h>
#include <linux/fs.h>
@@ -54,7 +52,6 @@
#include "journal-internal.h"
#include "journal-def.h"
#include "journal-verify.h"
-#include "journal-authenticate.h"
#include "journal-qrcode.h"
#include "journal-vacuum.h"
#include "fsprg.h"
diff --git a/src/journal/journald-console.c b/src/journal/journald-console.c
index 5363aaa4f..f7ea779f0 100644
--- a/src/journal/journald-console.c
+++ b/src/journal/journald-console.c
@@ -21,7 +21,6 @@
#include <time.h>
#include <fcntl.h>
-#include <unistd.h>
#include <sys/socket.h>
#include "fileio.h"
diff --git a/src/journal/journald-rate-limit.h b/src/journal/journald-rate-limit.h
index 648ab2278..466239d3c 100644
--- a/src/journal/journald-rate-limit.h
+++ b/src/journal/journald-rate-limit.h
@@ -21,7 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "macro.h"
#include "util.h"
typedef struct JournalRateLimit JournalRateLimit;
diff --git a/src/journal/journald-server.c b/src/journal/journald-server.c
index 7ee8174ea..248888463 100644
--- a/src/journal/journald-server.c
+++ b/src/journal/journald-server.c
@@ -24,20 +24,17 @@
#include <linux/sockios.h>
#include <sys/statvfs.h>
#include <sys/mman.h>
-#include <sys/timerfd.h>
#include <libudev.h>
#include "sd-journal.h"
#include "sd-messages.h"
#include "sd-daemon.h"
-#include "fileio.h"
#include "mkdir.h"
#include "hashmap.h"
#include "journal-file.h"
#include "socket-util.h"
#include "cgroup-util.h"
-#include "list.h"
#include "missing.h"
#include "conf-parser.h"
#include "selinux-util.h"
@@ -48,7 +45,6 @@
#include "journald-kmsg.h"
#include "journald-syslog.h"
#include "journald-stream.h"
-#include "journald-console.h"
#include "journald-native.h"
#include "journald-audit.h"
#include "journald-server.h"
diff --git a/src/journal/journald-server.h b/src/journal/journald-server.h
index c96877c50..559d10013 100644
--- a/src/journal/journald-server.h
+++ b/src/journal/journald-server.h
@@ -21,16 +21,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <inttypes.h>
#include <stdbool.h>
-#include <sys/epoll.h>
#include <sys/types.h>
-#include <sys/socket.h>
#include "sd-event.h"
#include "journal-file.h"
#include "hashmap.h"
-#include "util.h"
#include "audit.h"
#include "journald-rate-limit.h"
#include "list.h"
diff --git a/src/journal/journald-stream.c b/src/journal/journald-stream.c
index 942a85780..bc5b26d11 100644
--- a/src/journal/journald-stream.c
+++ b/src/journal/journald-stream.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <fcntl.h>
#include <unistd.h>
#include <stddef.h>
diff --git a/src/journal/journald.c b/src/journal/journald.c
index 80f4634f6..28a423326 100644
--- a/src/journal/journald.c
+++ b/src/journal/journald.c
@@ -19,12 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/epoll.h>
-#include <sys/socket.h>
-#include <errno.h>
#include <unistd.h>
-#include "systemd/sd-journal.h"
#include "systemd/sd-messages.h"
#include "systemd/sd-daemon.h"
diff --git a/src/journal/mmap-cache.c b/src/journal/mmap-cache.c
index ab21cdc28..22f75540b 100644
--- a/src/journal/mmap-cache.c
+++ b/src/journal/mmap-cache.c
@@ -22,7 +22,6 @@
#include <errno.h>
#include <stdlib.h>
#include <sys/mman.h>
-#include <string.h>
#include "hashmap.h"
#include "list.h"
diff --git a/src/journal/mmap-cache.h b/src/journal/mmap-cache.h
index a85c2b606..37ea7b4a9 100644
--- a/src/journal/mmap-cache.h
+++ b/src/journal/mmap-cache.h
@@ -21,7 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <inttypes.h>
#include <stdbool.h>
#include <sys/stat.h>
diff --git a/src/journal/test-catalog.c b/src/journal/test-catalog.c
index c605ee0e7..dbfdea609 100644
--- a/src/journal/test-catalog.c
+++ b/src/journal/test-catalog.c
@@ -21,7 +21,6 @@
***/
#include <locale.h>
-#include <stdlib.h>
#include <unistd.h>
#include <errno.h>
#include <fcntl.h>
diff --git a/src/journal/test-journal-enum.c b/src/journal/test-journal-enum.c
index 980244e01..cde2025ae 100644
--- a/src/journal/test-journal-enum.c
+++ b/src/journal/test-journal-enum.c
@@ -24,7 +24,6 @@
#include "log.h"
#include "sd-journal.h"
#include "macro.h"
-#include "util.h"
#include "journal-internal.h"
int main(int argc, char *argv[]) {
diff --git a/src/journal/test-journal-interleaving.c b/src/journal/test-journal-interleaving.c
index 3c706018e..3e6141771 100644
--- a/src/journal/test-journal-interleaving.c
+++ b/src/journal/test-journal-interleaving.c
@@ -26,7 +26,6 @@
#include "systemd/sd-journal.h"
#include "journal-file.h"
-#include "journal-internal.h"
#include "journal-vacuum.h"
#include "util.h"
#include "log.h"
diff --git a/src/journal/test-journal-verify.c b/src/journal/test-journal-verify.c
index 9da120c0b..de9cd9c8b 100644
--- a/src/journal/test-journal-verify.c
+++ b/src/journal/test-journal-verify.c
@@ -27,7 +27,6 @@
#include "log.h"
#include "journal-file.h"
#include "journal-verify.h"
-#include "journal-authenticate.h"
#define N_ENTRIES 6000
#define RANDOM_RANGE 77
diff --git a/src/journal/test-journal.c b/src/journal/test-journal.c
index 230d26596..f7cc75b3d 100644
--- a/src/journal/test-journal.c
+++ b/src/journal/test-journal.c
@@ -22,7 +22,6 @@
#include <fcntl.h>
#include <unistd.h>
-#include "systemd/sd-journal.h"
#include "log.h"
#include "journal-file.h"
diff --git a/src/journal/test-mmap-cache.c b/src/journal/test-mmap-cache.c
index 3fcd77475..3258b2270 100644
--- a/src/journal/test-mmap-cache.c
+++ b/src/journal/test-mmap-cache.c
@@ -24,7 +24,6 @@
#include <unistd.h>
#include <fcntl.h>
-#include "log.h"
#include "macro.h"
#include "util.h"
#include "mmap-cache.h"
diff --git a/src/libsystemd-network/dhcp-identifier.c b/src/libsystemd-network/dhcp-identifier.c
index 419a45043..f7a149236 100644
--- a/src/libsystemd-network/dhcp-identifier.c
+++ b/src/libsystemd-network/dhcp-identifier.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <net/ethernet.h>
#include "sd-id128.h"
#include "libudev.h"
@@ -28,7 +27,6 @@
#include "virt.h"
#include "sparse-endian.h"
#include "siphash24.h"
-#include "util.h"
#include "dhcp6-protocol.h"
#include "dhcp-identifier.h"
diff --git a/src/libsystemd-network/dhcp-identifier.h b/src/libsystemd-network/dhcp-identifier.h
index 7f44d2549..643d4970d 100644
--- a/src/libsystemd-network/dhcp-identifier.h
+++ b/src/libsystemd-network/dhcp-identifier.h
@@ -21,7 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <net/ethernet.h>
#include "macro.h"
#include "sparse-endian.h"
diff --git a/src/libsystemd-network/dhcp-network.c b/src/libsystemd-network/dhcp-network.c
index 5f2d2cfbf..7f10838de 100644
--- a/src/libsystemd-network/dhcp-network.c
+++ b/src/libsystemd-network/dhcp-network.c
@@ -18,7 +18,6 @@
***/
#include <errno.h>
-#include <sys/types.h>
#include <sys/socket.h>
#include <string.h>
#include <linux/if_packet.h>
@@ -26,7 +25,6 @@
#include <net/ethernet.h>
#include <net/if_arp.h>
#include <stdio.h>
-#include <unistd.h>
#include <linux/filter.h>
#include "socket-util.h"
diff --git a/src/libsystemd-network/dhcp-packet.c b/src/libsystemd-network/dhcp-packet.c
index 7581daeee..cd7f5095c 100644
--- a/src/libsystemd-network/dhcp-packet.c
+++ b/src/libsystemd-network/dhcp-packet.c
@@ -18,22 +18,14 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdlib.h>
#include <errno.h>
#include <string.h>
-#include <stdio.h>
#include <net/ethernet.h>
#include <net/if_arp.h>
-#include <sys/param.h>
-#include "util.h"
-#include "list.h"
#include "dhcp-protocol.h"
-#include "dhcp-lease-internal.h"
#include "dhcp-internal.h"
-#include "sd-dhcp-lease.h"
-#include "sd-dhcp-client.h"
#define DHCP_CLIENT_MIN_OPTIONS_SIZE 312
diff --git a/src/libsystemd-network/lldp-network.c b/src/libsystemd-network/lldp-network.c
index a2bc7d551..664d2f786 100644
--- a/src/libsystemd-network/lldp-network.c
+++ b/src/libsystemd-network/lldp-network.c
@@ -27,7 +27,6 @@
#include "lldp-tlv.h"
#include "lldp-network.h"
#include "lldp-internal.h"
-#include "sd-lldp.h"
int lldp_network_bind_raw_socket(int ifindex) {
typedef struct LLDPFrame {
diff --git a/src/libsystemd-network/network-internal.c b/src/libsystemd-network/network-internal.c
index b8e4e2171..d579755cc 100644
--- a/src/libsystemd-network/network-internal.c
+++ b/src/libsystemd-network/network-internal.c
@@ -25,7 +25,6 @@
#include "strv.h"
#include "siphash24.h"
-#include "libudev-private.h"
#include "dhcp-lease-internal.h"
#include "log.h"
#include "utf8.h"
diff --git a/src/libsystemd-network/network-internal.h b/src/libsystemd-network/network-internal.h
index e51717e91..06aba893c 100644
--- a/src/libsystemd-network/network-internal.h
+++ b/src/libsystemd-network/network-internal.h
@@ -21,8 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <netinet/ether.h>
-#include <netinet/in.h>
#include <stdbool.h>
#include "udev.h"
diff --git a/src/libsystemd-network/sd-dhcp-client.c b/src/libsystemd-network/sd-dhcp-client.c
index 5f90617b9..4224e0197 100644
--- a/src/libsystemd-network/sd-dhcp-client.c
+++ b/src/libsystemd-network/sd-dhcp-client.c
@@ -24,12 +24,9 @@
#include <net/ethernet.h>
#include <net/if_arp.h>
#include <linux/if_infiniband.h>
-#include <netinet/ether.h>
-#include <sys/param.h>
#include <sys/ioctl.h>
#include "util.h"
-#include "list.h"
#include "refcnt.h"
#include "async.h"
diff --git a/src/libsystemd-network/sd-dhcp-lease.c b/src/libsystemd-network/sd-dhcp-lease.c
index 34aa36c6e..fa1fa112b 100644
--- a/src/libsystemd-network/sd-dhcp-lease.c
+++ b/src/libsystemd-network/sd-dhcp-lease.c
@@ -22,22 +22,15 @@
#include <errno.h>
#include <string.h>
#include <stdio.h>
-#include <net/ethernet.h>
#include <arpa/inet.h>
-#include <sys/param.h>
-#include "util.h"
-#include "list.h"
-#include "mkdir.h"
#include "fileio.h"
#include "unaligned.h"
#include "in-addr-util.h"
#include "dhcp-protocol.h"
-#include "dhcp-internal.h"
#include "dhcp-lease-internal.h"
#include "sd-dhcp-lease.h"
-#include "sd-dhcp-client.h"
#include "network-internal.h"
int sd_dhcp_lease_get_address(sd_dhcp_lease *lease, struct in_addr *addr) {
diff --git a/src/libsystemd-network/sd-dhcp-server.c b/src/libsystemd-network/sd-dhcp-server.c
index 3f89f344d..2634a730d 100644
--- a/src/libsystemd-network/sd-dhcp-server.c
+++ b/src/libsystemd-network/sd-dhcp-server.c
@@ -21,7 +21,6 @@
***/
#include <sys/ioctl.h>
-#include <netinet/if_ether.h>
#include "siphash24.h"
diff --git a/src/libsystemd-network/sd-lldp.c b/src/libsystemd-network/sd-lldp.c
index 19ef2ccdb..082173033 100644
--- a/src/libsystemd-network/sd-lldp.c
+++ b/src/libsystemd-network/sd-lldp.c
@@ -24,16 +24,13 @@
#include "siphash24.h"
#include "hashmap.h"
-#include "event-util.h"
#include "lldp-tlv.h"
#include "lldp-port.h"
#include "sd-lldp.h"
#include "prioq.h"
-#include "strv.h"
#include "lldp-internal.h"
#include "lldp-util.h"
-#include "ether-addr-util.h"
typedef enum LLDPAgentRXState {
LLDP_AGENT_RX_WAIT_PORT_OPERATIONAL = 4,
diff --git a/src/libsystemd-network/sd-pppoe.c b/src/libsystemd-network/sd-pppoe.c
index 4f49b799e..67a2cc6e9 100644
--- a/src/libsystemd-network/sd-pppoe.c
+++ b/src/libsystemd-network/sd-pppoe.c
@@ -22,7 +22,6 @@
/* See RFC 2516 */
#include <sys/ioctl.h>
-#include <linux/ppp_defs.h>
#include <linux/ppp-ioctl.h>
#include <net/if.h>
#include <netinet/in.h>
@@ -36,7 +35,6 @@
#include "socket-util.h"
#include "async.h"
#include "refcnt.h"
-#include "unaligned.h"
#include "utf8.h"
#define PPPOE_MAX_PACKET_SIZE 1484
diff --git a/src/libsystemd-network/test-dhcp-client.c b/src/libsystemd-network/test-dhcp-client.c
index 8e8864143..d34121088 100644
--- a/src/libsystemd-network/test-dhcp-client.c
+++ b/src/libsystemd-network/test-dhcp-client.c
@@ -19,16 +19,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdlib.h>
-#include <assert.h>
#include <errno.h>
#include <stdio.h>
-#include <sys/types.h>
#include <sys/socket.h>
#include <unistd.h>
#include "util.h"
-#include "socket-util.h"
#include "sd-event.h"
#include "event-util.h"
diff --git a/src/libsystemd-network/test-dhcp-option.c b/src/libsystemd-network/test-dhcp-option.c
index 46c8c2706..6062a37da 100644
--- a/src/libsystemd-network/test-dhcp-option.c
+++ b/src/libsystemd-network/test-dhcp-option.c
@@ -3,7 +3,6 @@
#include <stdbool.h>
#include <errno.h>
#include <string.h>
-#include <assert.h>
#include "util.h"
#include "macro.h"
diff --git a/src/libsystemd-network/test-dhcp-server.c b/src/libsystemd-network/test-dhcp-server.c
index 3e68f310f..9f60ab761 100644
--- a/src/libsystemd-network/test-dhcp-server.c
+++ b/src/libsystemd-network/test-dhcp-server.c
@@ -20,8 +20,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <netinet/if_ether.h>
-#include <assert.h>
#include <errno.h>
#include "sd-event.h"
diff --git a/src/libsystemd-network/test-lldp.c b/src/libsystemd-network/test-lldp.c
index ee74ebd41..06545aee5 100644
--- a/src/libsystemd-network/test-lldp.c
+++ b/src/libsystemd-network/test-lldp.c
@@ -21,13 +21,8 @@
***/
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
-#include <sys/socket.h>
-#include <linux/if.h>
-#include <linux/if_ether.h>
#include <net/ethernet.h>
-#include <sys/types.h>
#include <arpa/inet.h>
#include "macro.h"
diff --git a/src/libsystemd-network/test-pppoe.c b/src/libsystemd-network/test-pppoe.c
index dff83eaf6..40d04fdb2 100644
--- a/src/libsystemd-network/test-pppoe.c
+++ b/src/libsystemd-network/test-pppoe.c
@@ -20,22 +20,16 @@
***/
#include <stdlib.h>
-#include <assert.h>
#include <errno.h>
-#include <stdio.h>
-#include <sys/types.h>
-#include <sys/socket.h>
#include <unistd.h>
#include <linux/veth.h>
#include <net/if.h>
#include "util.h"
-#include "socket-util.h"
#include "sd-event.h"
#include "event-util.h"
#include "sd-rtnl.h"
-#include "rtnl-util.h"
#include "sd-pppoe.h"
static void pppoe_handler(sd_pppoe *ppp, int event, void *userdata) {
diff --git a/src/libsystemd-terminal/evcat.c b/src/libsystemd-terminal/evcat.c
index f4c25b555..d274225ed 100644
--- a/src/libsystemd-terminal/evcat.c
+++ b/src/libsystemd-terminal/evcat.c
@@ -26,17 +26,13 @@
* problems.
*/
-#include <assert.h>
#include <errno.h>
#include <getopt.h>
#include <libevdev/libevdev.h>
#include <linux/kd.h>
-#include <linux/vt.h>
-#include <stdarg.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <systemd/sd-bus.h>
@@ -46,7 +42,6 @@
#include <unistd.h>
#include <xkbcommon/xkbcommon.h>
#include "build.h"
-#include "bus-util.h"
#include "event-util.h"
#include "idev.h"
#include "macro.h"
diff --git a/src/libsystemd-terminal/grdev-drm.c b/src/libsystemd-terminal/grdev-drm.c
index bc4d4c9e7..066a4d8b1 100644
--- a/src/libsystemd-terminal/grdev-drm.c
+++ b/src/libsystemd-terminal/grdev-drm.c
@@ -42,7 +42,6 @@
#include "grdev.h"
#include "grdev-internal.h"
#include "macro.h"
-#include "udev-util.h"
#include "util.h"
#define GRDRM_MAX_TRIES (16)
diff --git a/src/libsystemd-terminal/grdev.c b/src/libsystemd-terminal/grdev.c
index 3b3cf2737..feed57929 100644
--- a/src/libsystemd-terminal/grdev.c
+++ b/src/libsystemd-terminal/grdev.c
@@ -19,19 +19,16 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <inttypes.h>
#include <libudev.h>
#include <stdbool.h>
#include <stdlib.h>
#include <systemd/sd-bus.h>
#include <systemd/sd-event.h>
-#include <systemd/sd-login.h>
#include "grdev.h"
#include "grdev-internal.h"
#include "hashmap.h"
#include "login-shared.h"
#include "macro.h"
-#include "udev-util.h"
#include "util.h"
static void pipe_enable(grdev_pipe *pipe);
diff --git a/src/libsystemd-terminal/grdev.h b/src/libsystemd-terminal/grdev.h
index 35d6eb2ab..db2a508fd 100644
--- a/src/libsystemd-terminal/grdev.h
+++ b/src/libsystemd-terminal/grdev.h
@@ -53,8 +53,6 @@
#pragma once
-#include <drm_fourcc.h>
-#include <inttypes.h>
#include <libudev.h>
#include <stdbool.h>
#include <stdlib.h>
diff --git a/src/libsystemd-terminal/idev-evdev.c b/src/libsystemd-terminal/idev-evdev.c
index dfbb2d197..91ae507d9 100644
--- a/src/libsystemd-terminal/idev-evdev.c
+++ b/src/libsystemd-terminal/idev-evdev.c
@@ -20,20 +20,16 @@
***/
#include <fcntl.h>
-#include <inttypes.h>
#include <libevdev/libevdev.h>
#include <libudev.h>
#include <stdbool.h>
#include <stdlib.h>
#include <systemd/sd-bus.h>
#include <systemd/sd-event.h>
-#include <unistd.h>
#include "bus-util.h"
-#include "hashmap.h"
#include "idev.h"
#include "idev-internal.h"
#include "macro.h"
-#include "udev-util.h"
#include "util.h"
typedef struct idev_evdev idev_evdev;
diff --git a/src/libsystemd-terminal/idev-keyboard.c b/src/libsystemd-terminal/idev-keyboard.c
index 6ee3d8150..1ee13ffd1 100644
--- a/src/libsystemd-terminal/idev-keyboard.c
+++ b/src/libsystemd-terminal/idev-keyboard.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <inttypes.h>
#include <stdbool.h>
#include <stdlib.h>
#include <systemd/sd-bus.h>
diff --git a/src/libsystemd-terminal/idev.c b/src/libsystemd-terminal/idev.c
index 989683f39..44be7c30d 100644
--- a/src/libsystemd-terminal/idev.c
+++ b/src/libsystemd-terminal/idev.c
@@ -19,21 +19,16 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <inttypes.h>
#include <libudev.h>
-#include <linux/input.h>
#include <stdbool.h>
#include <stdlib.h>
#include <systemd/sd-bus.h>
#include <systemd/sd-event.h>
-#include <systemd/sd-login.h>
-#include <xkbcommon/xkbcommon.h>
#include "hashmap.h"
#include "idev.h"
#include "idev-internal.h"
#include "login-shared.h"
#include "macro.h"
-#include "udev-util.h"
#include "util.h"
static void element_open(idev_element *e);
diff --git a/src/libsystemd-terminal/idev.h b/src/libsystemd-terminal/idev.h
index c8c03f3d4..0e846179e 100644
--- a/src/libsystemd-terminal/idev.h
+++ b/src/libsystemd-terminal/idev.h
@@ -25,15 +25,12 @@
#pragma once
-#include <inttypes.h>
#include <libudev.h>
#include <linux/input.h>
#include <stdbool.h>
-#include <stdlib.h>
#include <systemd/sd-bus.h>
#include <systemd/sd-event.h>
#include <xkbcommon/xkbcommon.h>
-#include "util.h"
typedef struct idev_data idev_data;
typedef struct idev_data_evdev idev_data_evdev;
diff --git a/src/libsystemd-terminal/modeset.c b/src/libsystemd-terminal/modeset.c
index 6e13432d6..cccaabaa0 100644
--- a/src/libsystemd-terminal/modeset.c
+++ b/src/libsystemd-terminal/modeset.c
@@ -30,11 +30,9 @@
#include <errno.h>
#include <getopt.h>
#include <linux/kd.h>
-#include <linux/vt.h>
#include <stdbool.h>
#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <systemd/sd-bus.h>
@@ -43,10 +41,7 @@
#include <termios.h>
#include <unistd.h>
#include "build.h"
-#include "bus-util.h"
-#include "event-util.h"
#include "grdev.h"
-#include "grdev-internal.h"
#include "macro.h"
#include "sysview.h"
#include "util.h"
diff --git a/src/libsystemd-terminal/subterm.c b/src/libsystemd-terminal/subterm.c
index 63cd2a5ad..983a2a14a 100644
--- a/src/libsystemd-terminal/subterm.c
+++ b/src/libsystemd-terminal/subterm.c
@@ -26,7 +26,6 @@
* parent TTY. Think of this like what "GNU-screen" does.
*/
-#include <assert.h>
#include <errno.h>
#include <stdarg.h>
#include <stdbool.h>
diff --git a/src/libsystemd-terminal/sysview.c b/src/libsystemd-terminal/sysview.c
index 9ee32db1b..cd61ea44e 100644
--- a/src/libsystemd-terminal/sysview.c
+++ b/src/libsystemd-terminal/sysview.c
@@ -27,9 +27,7 @@
#include <systemd/sd-event.h>
#include <systemd/sd-login.h>
#include "bus-util.h"
-#include "event-util.h"
#include "macro.h"
-#include "set.h"
#include "sysview.h"
#include "sysview-internal.h"
#include "udev-util.h"
diff --git a/src/libsystemd-terminal/sysview.h b/src/libsystemd-terminal/sysview.h
index cad603d59..aa5527ff3 100644
--- a/src/libsystemd-terminal/sysview.h
+++ b/src/libsystemd-terminal/sysview.h
@@ -36,13 +36,9 @@
#pragma once
-#include <inttypes.h>
-#include <libudev.h>
#include <stdbool.h>
-#include <stdlib.h>
#include <systemd/sd-bus.h>
#include <systemd/sd-event.h>
-#include "util.h"
typedef struct sysview_event sysview_event;
typedef struct sysview_device sysview_device;
diff --git a/src/libsystemd-terminal/term-charset.c b/src/libsystemd-terminal/term-charset.c
index a00a1912d..9db178861 100644
--- a/src/libsystemd-terminal/term-charset.c
+++ b/src/libsystemd-terminal/term-charset.c
@@ -60,9 +60,6 @@
* include them. The mapper has to take care not to use them in GL.
*/
-#include <errno.h>
-#include <stdlib.h>
-#include <string.h>
#include "term-internal.h"
/*
diff --git a/src/libsystemd-terminal/term-page.c b/src/libsystemd-terminal/term-page.c
index ae73cdf62..cbd800673 100644
--- a/src/libsystemd-terminal/term-page.c
+++ b/src/libsystemd-terminal/term-page.c
@@ -75,7 +75,6 @@
#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
-#include <wchar.h>
#include "macro.h"
#include "term-internal.h"
#include "util.h"
diff --git a/src/libsystemd-terminal/term-wcwidth.c b/src/libsystemd-terminal/term-wcwidth.c
index df20a4045..833a099bd 100644
--- a/src/libsystemd-terminal/term-wcwidth.c
+++ b/src/libsystemd-terminal/term-wcwidth.c
@@ -62,7 +62,6 @@
* Latest version: http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c
*/
-#include <wchar.h>
#include "term-internal.h"
struct interval {
diff --git a/src/libsystemd-terminal/test-term-page.c b/src/libsystemd-terminal/test-term-page.c
index 9e338776e..d59139b62 100644
--- a/src/libsystemd-terminal/test-term-page.c
+++ b/src/libsystemd-terminal/test-term-page.c
@@ -25,14 +25,10 @@
* those internals are changed. They should be fairly obvious, though.
*/
-#include <assert.h>
-#include <errno.h>
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#include "macro.h"
#include "term-internal.h"
-#include "util.h"
#define MY_ASSERT_VALS __FILE__, __LINE__, __PRETTY_FUNCTION__
#define MY_ASSERT_FORW _FILE, _LINE, _FUNC
diff --git a/src/libsystemd-terminal/test-term-parser.c b/src/libsystemd-terminal/test-term-parser.c
index e22614d06..e40b267b1 100644
--- a/src/libsystemd-terminal/test-term-parser.c
+++ b/src/libsystemd-terminal/test-term-parser.c
@@ -22,14 +22,10 @@
* Terminal Parser Tests
*/
-#include <assert.h>
-#include <errno.h>
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#include "macro.h"
#include "term-internal.h"
-#include "util.h"
#include "utf8.h"
static void test_term_utf8_invalid(void) {
diff --git a/src/libsystemd-terminal/test-unifont.c b/src/libsystemd-terminal/test-unifont.c
index cfeef61a4..2366d3857 100644
--- a/src/libsystemd-terminal/test-unifont.c
+++ b/src/libsystemd-terminal/test-unifont.c
@@ -24,14 +24,11 @@
* The glyphs are then compared to hard-coded glyphs.
*/
-#include <errno.h>
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#include "macro.h"
#include "unifont-def.h"
#include "unifont.h"
-#include "util.h"
static void render(char *w, const unifont_glyph *g) {
unsigned int i, j;
diff --git a/src/libsystemd-terminal/unifont.c b/src/libsystemd-terminal/unifont.c
index 2acfa9821..0da81e8ff 100644
--- a/src/libsystemd-terminal/unifont.c
+++ b/src/libsystemd-terminal/unifont.c
@@ -28,13 +28,10 @@
#include <endian.h>
#include <fcntl.h>
-#include <stdbool.h>
#include <stdint.h>
#include <stdlib.h>
#include <sys/mman.h>
#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
#include "macro.h"
#include "unifont-def.h"
#include "unifont.h"
diff --git a/src/libsystemd-terminal/unifont.h b/src/libsystemd-terminal/unifont.h
index 30527cb3f..74ee5ecb3 100644
--- a/src/libsystemd-terminal/unifont.h
+++ b/src/libsystemd-terminal/unifont.h
@@ -21,10 +21,7 @@
#pragma once
-#include <stdbool.h>
#include <stdint.h>
-#include <stdlib.h>
-#include "util.h"
typedef struct unifont unifont;
typedef struct unifont_glyph unifont_glyph;
diff --git a/src/libsystemd/sd-bus/bus-bloom.h b/src/libsystemd/sd-bus/bus-bloom.h
index 96c82d7e8..a9350d7f5 100644
--- a/src/libsystemd/sd-bus/bus-bloom.h
+++ b/src/libsystemd/sd-bus/bus-bloom.h
@@ -23,7 +23,6 @@
#include <stdbool.h>
#include <stdint.h>
-#include <sys/types.h>
/*
* Our default bloom filter has the following parameters:
diff --git a/src/libsystemd/sd-bus/bus-common-errors.h b/src/libsystemd/sd-bus/bus-common-errors.h
index e935833bc..b17b62ac9 100644
--- a/src/libsystemd/sd-bus/bus-common-errors.h
+++ b/src/libsystemd/sd-bus/bus-common-errors.h
@@ -21,7 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "sd-bus.h"
#include "bus-error.h"
#define BUS_ERROR_NO_SUCH_UNIT "org.freedesktop.systemd1.NoSuchUnit"
diff --git a/src/libsystemd/sd-bus/bus-container.c b/src/libsystemd/sd-bus/bus-container.c
index d29b98a26..3b3a5d357 100644
--- a/src/libsystemd/sd-bus/bus-container.c
+++ b/src/libsystemd/sd-bus/bus-container.c
@@ -23,7 +23,6 @@
#include <fcntl.h>
#include "util.h"
-#include "fileio.h"
#include "bus-internal.h"
#include "bus-socket.h"
#include "bus-container.h"
diff --git a/src/libsystemd/sd-bus/bus-control.c b/src/libsystemd/sd-bus/bus-control.c
index bd439a95d..19aa4bd4f 100644
--- a/src/libsystemd/sd-bus/bus-control.c
+++ b/src/libsystemd/sd-bus/bus-control.c
@@ -34,7 +34,6 @@
#include "bus-bloom.h"
#include "bus-util.h"
#include "capability.h"
-#include "cgroup-util.h"
_public_ int sd_bus_get_unique_name(sd_bus *bus, const char **unique) {
int r;
diff --git a/src/libsystemd/sd-bus/bus-creds.c b/src/libsystemd/sd-bus/bus-creds.c
index ea8a619c5..a08391bfc 100644
--- a/src/libsystemd/sd-bus/bus-creds.c
+++ b/src/libsystemd/sd-bus/bus-creds.c
@@ -29,7 +29,6 @@
#include "audit.h"
#include "bus-message.h"
#include "bus-util.h"
-#include "time-util.h"
#include "strv.h"
#include "bus-creds.h"
#include "bus-label.h"
diff --git a/src/libsystemd/sd-bus/bus-creds.h b/src/libsystemd/sd-bus/bus-creds.h
index 3b337efa3..5430e535f 100644
--- a/src/libsystemd/sd-bus/bus-creds.h
+++ b/src/libsystemd/sd-bus/bus-creds.h
@@ -24,7 +24,6 @@
#include <stdbool.h>
#include "sd-bus.h"
-#include "time-util.h"
struct sd_bus_creds {
bool allocated;
diff --git a/src/libsystemd/sd-bus/bus-dump.c b/src/libsystemd/sd-bus/bus-dump.c
index 718163964..4bc896549 100644
--- a/src/libsystemd/sd-bus/bus-dump.c
+++ b/src/libsystemd/sd-bus/bus-dump.c
@@ -22,7 +22,6 @@
#include "util.h"
#include "capability.h"
#include "strv.h"
-#include "audit.h"
#include "macro.h"
#include "cap-list.h"
diff --git a/src/libsystemd/sd-bus/bus-gvariant.c b/src/libsystemd/sd-bus/bus-gvariant.c
index 02b95cd13..2d18a4e6c 100644
--- a/src/libsystemd/sd-bus/bus-gvariant.c
+++ b/src/libsystemd/sd-bus/bus-gvariant.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "util.h"
#include "bus-type.h"
#include "bus-gvariant.h"
#include "bus-signature.h"
diff --git a/src/libsystemd/sd-bus/bus-internal.h b/src/libsystemd/sd-bus/bus-internal.h
index bebb2c2fa..1351938c8 100644
--- a/src/libsystemd/sd-bus/bus-internal.h
+++ b/src/libsystemd/sd-bus/bus-internal.h
@@ -22,8 +22,6 @@
***/
#include <sys/socket.h>
-#include <sys/un.h>
-#include <netinet/in.h>
#include <pthread.h>
#include "hashmap.h"
diff --git a/src/libsystemd/sd-bus/bus-introspect.c b/src/libsystemd/sd-bus/bus-introspect.c
index d528ab2a0..e2f4550c7 100644
--- a/src/libsystemd/sd-bus/bus-introspect.c
+++ b/src/libsystemd/sd-bus/bus-introspect.c
@@ -20,7 +20,6 @@
***/
#include "util.h"
-#include "sd-bus-protocol.h"
#include "bus-introspect.h"
#include "bus-signature.h"
#include "bus-internal.h"
diff --git a/src/libsystemd/sd-bus/bus-introspect.h b/src/libsystemd/sd-bus/bus-introspect.h
index 98312d123..1914e6cb8 100644
--- a/src/libsystemd/sd-bus/bus-introspect.h
+++ b/src/libsystemd/sd-bus/bus-introspect.h
@@ -21,7 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
#include <stdio.h>
#include "sd-bus.h"
diff --git a/src/libsystemd/sd-bus/bus-kernel.c b/src/libsystemd/sd-bus/bus-kernel.c
index df772036e..4333445f2 100644
--- a/src/libsystemd/sd-bus/bus-kernel.c
+++ b/src/libsystemd/sd-bus/bus-kernel.c
@@ -38,7 +38,6 @@
#include "strv.h"
#include "memfd-util.h"
#include "capability.h"
-#include "cgroup-util.h"
#include "fileio.h"
#include "bus-internal.h"
diff --git a/src/libsystemd/sd-bus/bus-match.c b/src/libsystemd/sd-bus/bus-match.c
index 162f0ab60..a9e944c94 100644
--- a/src/libsystemd/sd-bus/bus-match.c
+++ b/src/libsystemd/sd-bus/bus-match.c
@@ -22,7 +22,6 @@
#include "bus-internal.h"
#include "bus-message.h"
#include "bus-match.h"
-#include "bus-error.h"
#include "bus-util.h"
#include "strv.h"
diff --git a/src/libsystemd/sd-bus/bus-message.c b/src/libsystemd/sd-bus/bus-message.c
index 076b85f3b..77216a6f4 100644
--- a/src/libsystemd/sd-bus/bus-message.c
+++ b/src/libsystemd/sd-bus/bus-message.c
@@ -27,7 +27,6 @@
#include "utf8.h"
#include "strv.h"
#include "time-util.h"
-#include "cgroup-util.h"
#include "memfd-util.h"
#include "sd-bus.h"
diff --git a/src/libsystemd/sd-bus/bus-message.h b/src/libsystemd/sd-bus/bus-message.h
index 32955329b..a68dee42b 100644
--- a/src/libsystemd/sd-bus/bus-message.h
+++ b/src/libsystemd/sd-bus/bus-message.h
@@ -23,11 +23,9 @@
#include <stdbool.h>
#include <byteswap.h>
-#include <sys/socket.h>
#include "macro.h"
#include "sd-bus.h"
-#include "kdbus.h"
#include "time-util.h"
#include "bus-creds.h"
#include "bus-protocol.h"
diff --git a/src/libsystemd/sd-bus/bus-signature.h b/src/libsystemd/sd-bus/bus-signature.h
index 2e06e3054..c4fed0b53 100644
--- a/src/libsystemd/sd-bus/bus-signature.h
+++ b/src/libsystemd/sd-bus/bus-signature.h
@@ -22,7 +22,6 @@
***/
#include <stdbool.h>
-#include <sys/types.h>
bool signature_is_single(const char *s, bool allow_dict_entry);
bool signature_is_pair(const char *s);
diff --git a/src/libsystemd/sd-bus/bus-socket.c b/src/libsystemd/sd-bus/bus-socket.c
index 52883fa8c..c15929c2b 100644
--- a/src/libsystemd/sd-bus/bus-socket.c
+++ b/src/libsystemd/sd-bus/bus-socket.c
@@ -20,16 +20,13 @@
***/
#include <endian.h>
-#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
#include <poll.h>
-#include <byteswap.h>
#include "util.h"
#include "macro.h"
#include "missing.h"
-#include "strv.h"
#include "utf8.h"
#include "sd-daemon.h"
diff --git a/src/libsystemd/sd-bus/bus-track.c b/src/libsystemd/sd-bus/bus-track.c
index 6be8310bb..048178550 100644
--- a/src/libsystemd/sd-bus/bus-track.c
+++ b/src/libsystemd/sd-bus/bus-track.c
@@ -20,7 +20,6 @@
***/
#include "sd-bus.h"
-#include "set.h"
#include "bus-util.h"
#include "bus-internal.h"
#include "bus-track.h"
diff --git a/src/libsystemd/sd-bus/bus-type.c b/src/libsystemd/sd-bus/bus-type.c
index b7914d15d..6bc7b880a 100644
--- a/src/libsystemd/sd-bus/bus-type.c
+++ b/src/libsystemd/sd-bus/bus-type.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "util.h"
#include "bus-type.h"
bool bus_type_is_valid(char c) {
diff --git a/src/libsystemd/sd-bus/bus-type.h b/src/libsystemd/sd-bus/bus-type.h
index 0e507839c..581574ab7 100644
--- a/src/libsystemd/sd-bus/bus-type.h
+++ b/src/libsystemd/sd-bus/bus-type.h
@@ -25,7 +25,6 @@
#include "macro.h"
#include "sd-bus.h"
-#include "sd-bus-protocol.h"
bool bus_type_is_valid(char c) _const_;
bool bus_type_is_valid_in_signature(char c) _const_;
diff --git a/src/libsystemd/sd-bus/bus-util.h b/src/libsystemd/sd-bus/bus-util.h
index e9efa3597..9f048711d 100644
--- a/src/libsystemd/sd-bus/bus-util.h
+++ b/src/libsystemd/sd-bus/bus-util.h
@@ -25,7 +25,6 @@
#include "sd-bus.h"
#include "hashmap.h"
#include "time-util.h"
-#include "util.h"
typedef enum BusTransport {
BUS_TRANSPORT_LOCAL,
diff --git a/src/libsystemd/sd-bus/busctl-introspect.h b/src/libsystemd/sd-bus/busctl-introspect.h
index d6b4cf05a..ea807d597 100644
--- a/src/libsystemd/sd-bus/busctl-introspect.h
+++ b/src/libsystemd/sd-bus/busctl-introspect.h
@@ -21,7 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <inttypes.h>
#include <stdbool.h>
typedef struct XMLIntrospectOps {
diff --git a/src/libsystemd/sd-bus/busctl.c b/src/libsystemd/sd-bus/busctl.c
index d3c177201..d52dbdfd8 100644
--- a/src/libsystemd/sd-bus/busctl.c
+++ b/src/libsystemd/sd-bus/busctl.c
@@ -26,12 +26,10 @@
#include "log.h"
#include "build.h"
#include "pager.h"
-#include "xml.h"
#include "path-util.h"
#include "set.h"
#include "sd-bus.h"
-#include "bus-message.h"
#include "bus-internal.h"
#include "bus-util.h"
#include "bus-dump.h"
diff --git a/src/libsystemd/sd-bus/sd-bus.c b/src/libsystemd/sd-bus/sd-bus.c
index 6a7f9c04a..58a625fed 100644
--- a/src/libsystemd/sd-bus/sd-bus.c
+++ b/src/libsystemd/sd-bus/sd-bus.c
@@ -20,19 +20,16 @@
***/
#include <endian.h>
-#include <assert.h>
#include <stdlib.h>
#include <unistd.h>
#include <netdb.h>
#include <poll.h>
-#include <byteswap.h>
#include <sys/mman.h>
#include <pthread.h>
#include "util.h"
#include "macro.h"
#include "strv.h"
-#include "set.h"
#include "missing.h"
#include "def.h"
#include "cgroup-util.h"
@@ -45,8 +42,6 @@
#include "bus-socket.h"
#include "bus-kernel.h"
#include "bus-control.h"
-#include "bus-introspect.h"
-#include "bus-signature.h"
#include "bus-objects.h"
#include "bus-util.h"
#include "bus-container.h"
diff --git a/src/libsystemd/sd-bus/test-bus-chat.c b/src/libsystemd/sd-bus/test-bus-chat.c
index 8625ee6d8..7f49fe90f 100644
--- a/src/libsystemd/sd-bus/test-bus-chat.c
+++ b/src/libsystemd/sd-bus/test-bus-chat.c
@@ -29,7 +29,6 @@
#include "macro.h"
#include "sd-bus.h"
-#include "bus-message.h"
#include "bus-error.h"
#include "bus-match.h"
#include "bus-internal.h"
diff --git a/src/libsystemd/sd-bus/test-bus-creds.c b/src/libsystemd/sd-bus/test-bus-creds.c
index ff2602ba3..edd5033db 100644
--- a/src/libsystemd/sd-bus/test-bus-creds.c
+++ b/src/libsystemd/sd-bus/test-bus-creds.c
@@ -22,7 +22,6 @@
#include "sd-bus.h"
#include "bus-dump.h"
#include "bus-util.h"
-#include "util.h"
int main(int argc, char *argv[]) {
_cleanup_bus_creds_unref_ sd_bus_creds *creds = NULL;
diff --git a/src/libsystemd/sd-bus/test-bus-introspect.c b/src/libsystemd/sd-bus/test-bus-introspect.c
index 67b6461f3..b2caa0287 100644
--- a/src/libsystemd/sd-bus/test-bus-introspect.c
+++ b/src/libsystemd/sd-bus/test-bus-introspect.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "util.h"
#include "log.h"
#include "bus-introspect.h"
diff --git a/src/libsystemd/sd-bus/test-bus-kernel-benchmark.c b/src/libsystemd/sd-bus/test-bus-kernel-benchmark.c
index 35f87e91b..1cacb95df 100644
--- a/src/libsystemd/sd-bus/test-bus-kernel-benchmark.c
+++ b/src/libsystemd/sd-bus/test-bus-kernel-benchmark.c
@@ -19,16 +19,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <ctype.h>
#include <sys/wait.h>
#include "util.h"
-#include "log.h"
#include "time-util.h"
#include "sd-bus.h"
-#include "bus-message.h"
-#include "bus-error.h"
#include "bus-kernel.h"
#include "bus-internal.h"
#include "bus-util.h"
diff --git a/src/libsystemd/sd-bus/test-bus-kernel-bloom.c b/src/libsystemd/sd-bus/test-bus-kernel-bloom.c
index 071b7e0cf..b11c43bd7 100644
--- a/src/libsystemd/sd-bus/test-bus-kernel-bloom.c
+++ b/src/libsystemd/sd-bus/test-bus-kernel-bloom.c
@@ -23,8 +23,6 @@
#include "log.h"
#include "sd-bus.h"
-#include "bus-message.h"
-#include "bus-error.h"
#include "bus-kernel.h"
#include "bus-util.h"
diff --git a/src/libsystemd/sd-bus/test-bus-kernel.c b/src/libsystemd/sd-bus/test-bus-kernel.c
index c396eac2d..8f4f60b65 100644
--- a/src/libsystemd/sd-bus/test-bus-kernel.c
+++ b/src/libsystemd/sd-bus/test-bus-kernel.c
@@ -25,8 +25,6 @@
#include "log.h"
#include "sd-bus.h"
-#include "bus-message.h"
-#include "bus-error.h"
#include "bus-kernel.h"
#include "bus-util.h"
#include "bus-dump.h"
diff --git a/src/libsystemd/sd-bus/test-bus-marshal.c b/src/libsystemd/sd-bus/test-bus-marshal.c
index d95a03c22..7569ff98b 100644
--- a/src/libsystemd/sd-bus/test-bus-marshal.c
+++ b/src/libsystemd/sd-bus/test-bus-marshal.c
@@ -19,9 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <stdlib.h>
-#include <byteswap.h>
#include <math.h>
#ifdef HAVE_GLIB
diff --git a/src/libsystemd/sd-bus/test-bus-match.c b/src/libsystemd/sd-bus/test-bus-match.c
index 76ca0b6bf..051969f9c 100644
--- a/src/libsystemd/sd-bus/test-bus-match.c
+++ b/src/libsystemd/sd-bus/test-bus-match.c
@@ -20,7 +20,6 @@
***/
#include "log.h"
-#include "util.h"
#include "macro.h"
#include "bus-match.h"
diff --git a/src/libsystemd/sd-bus/test-bus-objects.c b/src/libsystemd/sd-bus/test-bus-objects.c
index acf67a52b..895eda4ea 100644
--- a/src/libsystemd/sd-bus/test-bus-objects.c
+++ b/src/libsystemd/sd-bus/test-bus-objects.c
@@ -19,11 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <stdlib.h>
#include <pthread.h>
-#include <unistd.h>
-#include <fcntl.h>
#include "log.h"
#include "util.h"
diff --git a/src/libsystemd/sd-bus/test-bus-server.c b/src/libsystemd/sd-bus/test-bus-server.c
index 5f807c3b1..080d8eddb 100644
--- a/src/libsystemd/sd-bus/test-bus-server.c
+++ b/src/libsystemd/sd-bus/test-bus-server.c
@@ -19,11 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <stdlib.h>
#include <pthread.h>
-#include <unistd.h>
-#include <fcntl.h>
#include "log.h"
#include "util.h"
@@ -31,7 +28,6 @@
#include "sd-bus.h"
#include "bus-internal.h"
-#include "bus-message.h"
#include "bus-util.h"
struct context {
diff --git a/src/libsystemd/sd-bus/test-bus-signature.c b/src/libsystemd/sd-bus/test-bus-signature.c
index 3fc565c62..4165c9273 100644
--- a/src/libsystemd/sd-bus/test-bus-signature.c
+++ b/src/libsystemd/sd-bus/test-bus-signature.c
@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
-#include <stdlib.h>
#include "log.h"
#include "bus-signature.h"
diff --git a/src/libsystemd/sd-bus/test-bus-zero-copy.c b/src/libsystemd/sd-bus/test-bus-zero-copy.c
index 4ea9f9fc3..2d062fc9b 100644
--- a/src/libsystemd/sd-bus/test-bus-zero-copy.c
+++ b/src/libsystemd/sd-bus/test-bus-zero-copy.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <fcntl.h>
#include <sys/mman.h>
#include "util.h"
@@ -28,7 +27,6 @@
#include "sd-bus.h"
#include "bus-message.h"
-#include "bus-error.h"
#include "bus-kernel.h"
#include "bus-dump.h"
diff --git a/src/libsystemd/sd-daemon/sd-daemon.c b/src/libsystemd/sd-daemon/sd-daemon.c
index 028c2a7a5..c9e2f2dba 100644
--- a/src/libsystemd/sd-daemon/sd-daemon.c
+++ b/src/libsystemd/sd-daemon/sd-daemon.c
@@ -19,11 +19,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
#include <sys/stat.h>
#include <sys/socket.h>
#include <sys/un.h>
-#include <fcntl.h>
#include <netinet/in.h>
#include <stdlib.h>
#include <errno.h>
diff --git a/src/libsystemd/sd-event/sd-event.c b/src/libsystemd/sd-event/sd-event.c
index 25089a033..0c4e5179e 100644
--- a/src/libsystemd/sd-event/sd-event.c
+++ b/src/libsystemd/sd-event/sd-event.c
@@ -22,7 +22,6 @@
#include <sys/epoll.h>
#include <sys/timerfd.h>
#include <sys/wait.h>
-#include <pthread.h>
#include "sd-id128.h"
#include "sd-daemon.h"
diff --git a/src/libsystemd/sd-hwdb/sd-hwdb.c b/src/libsystemd/sd-hwdb/sd-hwdb.c
index 61c7b446b..3bbf02896 100644
--- a/src/libsystemd/sd-hwdb/sd-hwdb.c
+++ b/src/libsystemd/sd-hwdb/sd-hwdb.c
@@ -23,10 +23,8 @@
#include <errno.h>
#include <string.h>
#include <inttypes.h>
-#include <ctype.h>
#include <stdlib.h>
#include <fnmatch.h>
-#include <getopt.h>
#include <sys/mman.h>
#include "sd-hwdb.h"
diff --git a/src/libsystemd/sd-network/network-util.h b/src/libsystemd/sd-network/network-util.h
index 02bd54552..11a001234 100644
--- a/src/libsystemd/sd-network/network-util.h
+++ b/src/libsystemd/sd-network/network-util.h
@@ -21,7 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "util.h"
#include "sd-network.h"
DEFINE_TRIVIAL_CLEANUP_FUNC(sd_network_monitor*, sd_network_monitor_unref);
diff --git a/src/libsystemd/sd-network/sd-network.c b/src/libsystemd/sd-network/sd-network.c
index c4713feb5..297fdac80 100644
--- a/src/libsystemd/sd-network/sd-network.c
+++ b/src/libsystemd/sd-network/sd-network.c
@@ -20,19 +20,16 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <sys/inotify.h>
#include <poll.h>
-#include <net/if.h>
#include "util.h"
#include "macro.h"
#include "strv.h"
#include "fileio.h"
#include "sd-network.h"
-#include "network-internal.h"
_public_ int sd_network_get_operational_state(char **state) {
_cleanup_free_ char *s = NULL;
diff --git a/src/libsystemd/sd-resolve/sd-resolve.c b/src/libsystemd/sd-resolve/sd-resolve.c
index 6448280c4..ca517861d 100644
--- a/src/libsystemd/sd-resolve/sd-resolve.c
+++ b/src/libsystemd/sd-resolve/sd-resolve.c
@@ -19,24 +19,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
-#include <fcntl.h>
#include <signal.h>
#include <unistd.h>
-#include <sys/select.h>
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <errno.h>
-#include <sys/wait.h>
-#include <sys/types.h>
-#include <pwd.h>
-#include <netinet/in.h>
-#include <arpa/nameser.h>
#include <resolv.h>
-#include <dirent.h>
-#include <sys/time.h>
-#include <sys/resource.h>
#include <stdint.h>
#include <pthread.h>
#include <sys/prctl.h>
diff --git a/src/libsystemd/sd-resolve/test-resolve.c b/src/libsystemd/sd-resolve/test-resolve.c
index d08e1b5a0..3187ce9b8 100644
--- a/src/libsystemd/sd-resolve/test-resolve.c
+++ b/src/libsystemd/sd-resolve/test-resolve.c
@@ -21,14 +21,11 @@
***/
#include <string.h>
-#include <sys/types.h>
#include <sys/socket.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <netinet/in.h>
-#include <arpa/nameser.h>
#include <resolv.h>
-#include <signal.h>
#include <errno.h>
#include "socket-util.h"
diff --git a/src/libsystemd/sd-rtnl/local-addresses.h b/src/libsystemd/sd-rtnl/local-addresses.h
index ef7def530..bdc28d351 100644
--- a/src/libsystemd/sd-rtnl/local-addresses.h
+++ b/src/libsystemd/sd-rtnl/local-addresses.h
@@ -21,10 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <inttypes.h>
-#include <sys/types.h>
-#include <assert.h>
-#include <sys/socket.h>
#include "sd-rtnl.h"
#include "in-addr-util.h"
diff --git a/src/libsystemd/sd-rtnl/rtnl-message.c b/src/libsystemd/sd-rtnl/rtnl-message.c
index 276591f31..8f7d50abb 100644
--- a/src/libsystemd/sd-rtnl/rtnl-message.c
+++ b/src/libsystemd/sd-rtnl/rtnl-message.c
@@ -20,7 +20,6 @@
***/
#include <netinet/in.h>
-#include <netinet/ether.h>
#include <stdbool.h>
#include <unistd.h>
diff --git a/src/libsystemd/sd-rtnl/rtnl-types.c b/src/libsystemd/sd-rtnl/rtnl-types.c
index a4c71f378..3f4ba2e0f 100644
--- a/src/libsystemd/sd-rtnl/rtnl-types.c
+++ b/src/libsystemd/sd-rtnl/rtnl-types.c
@@ -19,12 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stddef.h>
#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>
diff --git a/src/libsystemd/sd-rtnl/rtnl-util.c b/src/libsystemd/sd-rtnl/rtnl-util.c
index 5666ea44c..9ddf074c2 100644
--- a/src/libsystemd/sd-rtnl/rtnl-util.c
+++ b/src/libsystemd/sd-rtnl/rtnl-util.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <netinet/ether.h>
#include "sd-rtnl.h"
diff --git a/src/libsystemd/sd-rtnl/rtnl-util.h b/src/libsystemd/sd-rtnl/rtnl-util.h
index ca9fbd4f4..9e4bdb867 100644
--- a/src/libsystemd/sd-rtnl/rtnl-util.h
+++ b/src/libsystemd/sd-rtnl/rtnl-util.h
@@ -21,7 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <netinet/ether.h>
#include "util.h"
#include "sd-rtnl.h"
diff --git a/src/libsystemd/sd-rtnl/test-rtnl.c b/src/libsystemd/sd-rtnl/test-rtnl.c
index 02f7a8e38..47cce6481 100644
--- a/src/libsystemd/sd-rtnl/test-rtnl.c
+++ b/src/libsystemd/sd-rtnl/test-rtnl.c
@@ -29,7 +29,6 @@
#include "rtnl-util.h"
#include "event-util.h"
#include "missing.h"
-#include "rtnl-internal.h"
static void test_message_link_bridge(sd_rtnl *rtnl) {
_cleanup_rtnl_message_unref_ sd_rtnl_message *message = NULL;
diff --git a/src/libudev/libudev-device-private.c b/src/libudev/libudev-device-private.c
index fb4c6e294..15d3b231c 100644
--- a/src/libudev/libudev-device-private.c
+++ b/src/libudev/libudev-device-private.c
@@ -17,7 +17,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <stddef.h>
diff --git a/src/libudev/libudev-enumerate.c b/src/libudev/libudev-enumerate.c
index 1a880c2a3..4e6e47cde 100644
--- a/src/libudev/libudev-enumerate.c
+++ b/src/libudev/libudev-enumerate.c
@@ -20,14 +20,12 @@
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <unistd.h>
#include <errno.h>
#include <string.h>
#include <dirent.h>
#include <fnmatch.h>
#include <stdbool.h>
#include <sys/stat.h>
-#include <sys/param.h>
#include "libudev.h"
#include "libudev-private.h"
diff --git a/src/libudev/libudev-list.c b/src/libudev/libudev-list.c
index 42fcb853c..044ee3a0c 100644
--- a/src/libudev/libudev-list.c
+++ b/src/libudev/libudev-list.c
@@ -17,14 +17,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
-#include <unistd.h>
#include <errno.h>
#include <string.h>
-#include "libudev.h"
#include "libudev-private.h"
/**
diff --git a/src/libudev/libudev-monitor.c b/src/libudev/libudev-monitor.c
index 3f1fee7f7..eb7b6f87b 100644
--- a/src/libudev/libudev-monitor.c
+++ b/src/libudev/libudev-monitor.c
@@ -23,12 +23,8 @@
#include <unistd.h>
#include <errno.h>
#include <string.h>
-#include <dirent.h>
#include <poll.h>
-#include <sys/stat.h>
#include <sys/socket.h>
-#include <sys/un.h>
-#include <arpa/inet.h>
#include <linux/netlink.h>
#include <linux/filter.h>
diff --git a/src/libudev/libudev-queue.c b/src/libudev/libudev-queue.c
index 8ef1f3d4b..11e15d13e 100644
--- a/src/libudev/libudev-queue.c
+++ b/src/libudev/libudev-queue.c
@@ -18,17 +18,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <unistd.h>
#include <errno.h>
-#include <string.h>
-#include <limits.h>
-#include <sys/stat.h>
#include <sys/inotify.h>
-#include "libudev.h"
#include "libudev-private.h"
/**
diff --git a/src/libudev/libudev-util.c b/src/libudev/libudev-util.c
index 291829e6d..0f8f634ca 100644
--- a/src/libudev/libudev-util.c
+++ b/src/libudev/libudev-util.c
@@ -17,20 +17,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <unistd.h>
#include <errno.h>
#include <string.h>
-#include <dirent.h>
#include <ctype.h>
-#include <fcntl.h>
-#include <time.h>
-#include <pwd.h>
-#include <grp.h>
-#include <sys/stat.h>
-#include <sys/param.h>
#include "device-nodes.h"
#include "libudev.h"
diff --git a/src/libudev/libudev.c b/src/libudev/libudev.c
index 8785f2207..ec15d2576 100644
--- a/src/libudev/libudev.c
+++ b/src/libudev/libudev.c
@@ -21,11 +21,8 @@
#include <stdlib.h>
#include <stddef.h>
#include <stdarg.h>
-#include <unistd.h>
-#include <errno.h>
#include <string.h>
#include <ctype.h>
-#include <time.h>
#include "libudev.h"
#include "libudev-private.h"
diff --git a/src/libudev/libudev.h b/src/libudev/libudev.h
index a94505c09..eb58740d2 100644
--- a/src/libudev/libudev.h
+++ b/src/libudev/libudev.h
@@ -22,7 +22,6 @@
#include <stdarg.h>
#include <sys/types.h>
-#include <sys/stat.h>
#ifdef __cplusplus
extern "C" {
diff --git a/src/locale/localectl.c b/src/locale/localectl.c
index 41a88a828..515fca540 100644
--- a/src/locale/localectl.c
+++ b/src/locale/localectl.c
@@ -23,25 +23,19 @@
#include <locale.h>
#include <stdlib.h>
#include <stdbool.h>
-#include <unistd.h>
#include <getopt.h>
#include <string.h>
#include <ftw.h>
-#include <sys/mman.h>
-#include <fcntl.h>
#include "sd-bus.h"
#include "bus-util.h"
#include "bus-error.h"
-#include "bus-message.h"
#include "util.h"
#include "spawn-polkit-agent.h"
#include "build.h"
#include "strv.h"
#include "pager.h"
#include "set.h"
-#include "path-util.h"
-#include "utf8.h"
#include "def.h"
#include "virt.h"
#include "fileio.h"
diff --git a/src/locale/localed.c b/src/locale/localed.c
index 5119fcd9b..1fb8cdc34 100644
--- a/src/locale/localed.c
+++ b/src/locale/localed.c
@@ -33,7 +33,6 @@
#include "env-util.h"
#include "fileio.h"
#include "fileio-label.h"
-#include "label.h"
#include "bus-util.h"
#include "bus-error.h"
#include "bus-message.h"
diff --git a/src/login/inhibit.c b/src/login/inhibit.c
index 44bda34af..fcc8d7223 100644
--- a/src/login/inhibit.c
+++ b/src/login/inhibit.c
@@ -20,7 +20,6 @@
***/
#include <getopt.h>
-#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
diff --git a/src/login/loginctl.c b/src/login/loginctl.c
index 13b810248..ec102ae4c 100644
--- a/src/login/loginctl.c
+++ b/src/login/loginctl.c
@@ -23,7 +23,6 @@
#include <errno.h>
#include <string.h>
#include <getopt.h>
-#include <pwd.h>
#include <locale.h>
#include "sd-bus.h"
diff --git a/src/login/logind-acl.c b/src/login/logind-acl.c
index 5856f9079..941fd724a 100644
--- a/src/login/logind-acl.c
+++ b/src/login/logind-acl.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>
diff --git a/src/login/logind-action.c b/src/login/logind-action.c
index 0844df20a..20c1c89ee 100644
--- a/src/login/logind-action.c
+++ b/src/login/logind-action.c
@@ -21,7 +21,6 @@
#include <unistd.h>
-#include "sd-messages.h"
#include "conf-parser.h"
#include "special.h"
#include "sleep-config.h"
diff --git a/src/login/logind-action.h b/src/login/logind-action.h
index e9b424b5f..ff9806537 100644
--- a/src/login/logind-action.h
+++ b/src/login/logind-action.h
@@ -36,7 +36,6 @@ typedef enum HandleAction {
} HandleAction;
#include "logind.h"
-#include "logind-inhibit.h"
int manager_handle_action(
Manager *m,
diff --git a/src/login/logind-button.c b/src/login/logind-button.c
index d7211e66c..610adc513 100644
--- a/src/login/logind-button.c
+++ b/src/login/logind-button.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
@@ -28,9 +27,7 @@
#include <linux/input.h>
#include "sd-messages.h"
-#include "conf-parser.h"
#include "util.h"
-#include "special.h"
#include "logind-button.h"
Button* button_new(Manager *m, const char *name) {
diff --git a/src/login/logind-button.h b/src/login/logind-button.h
index 72a612e91..80d93c7e6 100644
--- a/src/login/logind-button.h
+++ b/src/login/logind-button.h
@@ -23,8 +23,6 @@
typedef struct Button Button;
-#include "list.h"
-#include "util.h"
#include "logind.h"
struct Button {
diff --git a/src/login/logind-core.c b/src/login/logind-core.c
index a6ff5add9..e8da59a18 100644
--- a/src/login/logind-core.c
+++ b/src/login/logind-core.c
@@ -20,16 +20,13 @@
***/
#include <sys/types.h>
-#include <sys/stat.h>
#include <sys/ioctl.h>
#include <fcntl.h>
#include <pwd.h>
-#include <unistd.h>
#include <linux/vt.h>
#include "strv.h"
#include "cgroup-util.h"
-#include "audit.h"
#include "bus-util.h"
#include "bus-error.h"
#include "udev-util.h"
diff --git a/src/login/logind-dbus.c b/src/login/logind-dbus.c
index 5d61edbd4..3322d66aa 100644
--- a/src/login/logind-dbus.c
+++ b/src/login/logind-dbus.c
@@ -24,7 +24,6 @@
#include <unistd.h>
#include <pwd.h>
-#include "sd-id128.h"
#include "sd-messages.h"
#include "strv.h"
#include "mkdir.h"
@@ -32,10 +31,7 @@
#include "special.h"
#include "sleep-config.h"
#include "fileio-label.h"
-#include "label.h"
-#include "utf8.h"
#include "unit-name.h"
-#include "virt.h"
#include "audit.h"
#include "bus-util.h"
#include "bus-error.h"
diff --git a/src/login/logind-device.c b/src/login/logind-device.c
index 76c5a5c88..ee4c45fb8 100644
--- a/src/login/logind-device.c
+++ b/src/login/logind-device.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <string.h>
#include "util.h"
diff --git a/src/login/logind-device.h b/src/login/logind-device.h
index c273d2bfa..6b2728586 100644
--- a/src/login/logind-device.h
+++ b/src/login/logind-device.h
@@ -24,8 +24,6 @@
typedef struct Device Device;
#include "list.h"
-#include "util.h"
-#include "logind.h"
#include "logind-seat.h"
#include "logind-session-device.h"
diff --git a/src/login/logind-inhibit.c b/src/login/logind-inhibit.c
index 84fee0e77..5d81693e6 100644
--- a/src/login/logind-inhibit.c
+++ b/src/login/logind-inhibit.c
@@ -26,7 +26,6 @@
#include "util.h"
#include "mkdir.h"
-#include "path-util.h"
#include "logind-inhibit.h"
#include "fileio.h"
diff --git a/src/login/logind-inhibit.h b/src/login/logind-inhibit.h
index f767876a4..1b77fc1e9 100644
--- a/src/login/logind-inhibit.h
+++ b/src/login/logind-inhibit.h
@@ -23,8 +23,6 @@
typedef struct Inhibitor Inhibitor;
-#include "list.h"
-#include "util.h"
typedef enum InhibitWhat {
INHIBIT_SHUTDOWN = 1,
@@ -46,7 +44,6 @@ typedef enum InhibitMode {
} InhibitMode;
#include "logind.h"
-#include "logind-seat.h"
struct Inhibitor {
Manager *manager;
diff --git a/src/login/logind-seat.c b/src/login/logind-seat.c
index 126c5b84c..49808c928 100644
--- a/src/login/logind-seat.c
+++ b/src/login/logind-seat.c
@@ -19,21 +19,16 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <errno.h>
#include <unistd.h>
#include <fcntl.h>
-#include <sys/ioctl.h>
-#include <linux/vt.h>
#include <string.h>
-#include "sd-id128.h"
#include "sd-messages.h"
#include "logind-seat.h"
#include "logind-acl.h"
#include "util.h"
#include "mkdir.h"
-#include "path-util.h"
Seat *seat_new(Manager *m, const char *id) {
Seat *s;
diff --git a/src/login/logind-seat.h b/src/login/logind-seat.h
index 15f11b85a..2a0f574be 100644
--- a/src/login/logind-seat.h
+++ b/src/login/logind-seat.h
@@ -24,9 +24,6 @@
typedef struct Seat Seat;
#include "list.h"
-#include "util.h"
-#include "logind.h"
-#include "logind-device.h"
#include "logind-session.h"
struct Seat {
diff --git a/src/login/logind-session-device.c b/src/login/logind-session-device.c
index c2de86225..656f268db 100644
--- a/src/login/logind-session-device.c
+++ b/src/login/logind-session-device.c
@@ -19,16 +19,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <fcntl.h>
#include <libudev.h>
#include <linux/input.h>
-#include <linux/ioctl.h>
#include <string.h>
#include <sys/ioctl.h>
-#include <sys/stat.h>
#include <sys/types.h>
-#include <unistd.h>
#include "util.h"
#include "missing.h"
diff --git a/src/login/logind-session-device.h b/src/login/logind-session-device.h
index 61a843d09..1c9f99837 100644
--- a/src/login/logind-session-device.h
+++ b/src/login/logind-session-device.h
@@ -25,11 +25,7 @@ typedef enum DeviceType DeviceType;
typedef struct SessionDevice SessionDevice;
#include "list.h"
-#include "util.h"
#include "logind.h"
-#include "logind-device.h"
-#include "logind-seat.h"
-#include "logind-session.h"
enum DeviceType {
DEVICE_TYPE_UNKNOWN,
diff --git a/src/login/logind-session.c b/src/login/logind-session.c
index a02a537f7..ce5dbb4d5 100644
--- a/src/login/logind-session.c
+++ b/src/login/logind-session.c
@@ -28,9 +28,7 @@
#include <sys/ioctl.h>
#include <unistd.h>
-#include "sd-id128.h"
#include "sd-messages.h"
-#include "strv.h"
#include "util.h"
#include "mkdir.h"
#include "path-util.h"
diff --git a/src/login/logind-session.h b/src/login/logind-session.h
index 3ec9d84f9..0505f7f0b 100644
--- a/src/login/logind-session.h
+++ b/src/login/logind-session.h
@@ -25,10 +25,6 @@ typedef struct Session Session;
typedef enum KillWho KillWho;
#include "list.h"
-#include "util.h"
-#include "logind.h"
-#include "logind-seat.h"
-#include "logind-session-device.h"
#include "logind-user.h"
#include "login-shared.h"
diff --git a/src/login/logind-user.c b/src/login/logind-user.c
index f4c4490e8..294c1e799 100644
--- a/src/login/logind-user.c
+++ b/src/login/logind-user.c
@@ -27,7 +27,6 @@
#include "util.h"
#include "mkdir.h"
#include "hashmap.h"
-#include "strv.h"
#include "fileio.h"
#include "path-util.h"
#include "special.h"
diff --git a/src/login/logind-user.h b/src/login/logind-user.h
index 2cb57e167..be5b56883 100644
--- a/src/login/logind-user.h
+++ b/src/login/logind-user.h
@@ -24,9 +24,7 @@
typedef struct User User;
#include "list.h"
-#include "util.h"
#include "logind.h"
-#include "logind-session.h"
typedef enum UserState {
USER_OFFLINE, /* Not logged in at all */
diff --git a/src/login/logind.c b/src/login/logind.c
index b44f37642..08a7cbc08 100644
--- a/src/login/logind.c
+++ b/src/login/logind.c
@@ -24,13 +24,10 @@
#include <fcntl.h>
#include <string.h>
#include <unistd.h>
-#include <linux/vt.h>
-#include <sys/timerfd.h>
#include "sd-daemon.h"
#include "strv.h"
#include "conf-parser.h"
-#include "mkdir.h"
#include "bus-util.h"
#include "bus-error.h"
#include "logind.h"
diff --git a/src/login/logind.h b/src/login/logind.h
index e0cb7d023..48e647ae8 100644
--- a/src/login/logind.h
+++ b/src/login/logind.h
@@ -22,12 +22,10 @@
***/
#include <stdbool.h>
-#include <inttypes.h>
#include <libudev.h>
#include "sd-event.h"
#include "sd-bus.h"
-#include "util.h"
#include "list.h"
#include "hashmap.h"
#include "set.h"
@@ -35,9 +33,6 @@
typedef struct Manager Manager;
#include "logind-device.h"
-#include "logind-seat.h"
-#include "logind-session.h"
-#include "logind-user.h"
#include "logind-inhibit.h"
#include "logind-button.h"
#include "logind-action.h"
diff --git a/src/login/test-inhibit.c b/src/login/test-inhibit.c
index 274687d20..03516de91 100644
--- a/src/login/test-inhibit.c
+++ b/src/login/test-inhibit.c
@@ -25,7 +25,6 @@
#include "util.h"
#include "sd-bus.h"
#include "bus-util.h"
-#include "bus-error.h"
static int inhibit(sd_bus *bus, const char *what) {
_cleanup_bus_message_unref_ sd_bus_message *reply = NULL;
diff --git a/src/login/user-sessions.c b/src/login/user-sessions.c
index 6edb823e8..1c31769fd 100644
--- a/src/login/user-sessions.c
+++ b/src/login/user-sessions.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <string.h>
#include <unistd.h>
#include <errno.h>
diff --git a/src/machine-id-commit/machine-id-commit.c b/src/machine-id-commit/machine-id-commit.c
index c7e4de888..d9c1b7c7a 100644
--- a/src/machine-id-commit/machine-id-commit.c
+++ b/src/machine-id-commit/machine-id-commit.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <getopt.h>
diff --git a/src/machine-id-setup/machine-id-setup-main.c b/src/machine-id-setup/machine-id-setup-main.c
index 85bbfc429..20cb60b80 100644
--- a/src/machine-id-setup/machine-id-setup-main.c
+++ b/src/machine-id-setup/machine-id-setup-main.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <unistd.h>
#include <stdlib.h>
#include <stdio.h>
#include <getopt.h>
diff --git a/src/machine/image-dbus.c b/src/machine/image-dbus.c
index ef1914e2b..9061017ee 100644
--- a/src/machine/image-dbus.c
+++ b/src/machine/image-dbus.c
@@ -20,7 +20,6 @@
***/
#include "bus-label.h"
-#include "bus-common-errors.h"
#include "strv.h"
#include "bus-util.h"
#include "machine-image.h"
diff --git a/src/machine/machine-dbus.c b/src/machine/machine-dbus.c
index 116e711a7..334abbdeb 100644
--- a/src/machine/machine-dbus.c
+++ b/src/machine/machine-dbus.c
@@ -21,7 +21,6 @@
#include <errno.h>
#include <string.h>
-#include <arpa/inet.h>
#include <sys/mount.h>
/* When we include libgen.h because we need dirname() we immediately
diff --git a/src/machine/machine-dbus.h b/src/machine/machine-dbus.h
index dc9115d39..4eb24f9a1 100644
--- a/src/machine/machine-dbus.h
+++ b/src/machine/machine-dbus.h
@@ -22,7 +22,6 @@
***/
#include "sd-bus.h"
-#include "machine.h"
extern const sd_bus_vtable machine_vtable[];
diff --git a/src/machine/machine.c b/src/machine/machine.c
index edd244f30..182430d78 100644
--- a/src/machine/machine.c
+++ b/src/machine/machine.c
@@ -28,7 +28,6 @@
#include "util.h"
#include "mkdir.h"
#include "hashmap.h"
-#include "strv.h"
#include "fileio.h"
#include "special.h"
#include "unit-name.h"
diff --git a/src/machine/machine.h b/src/machine/machine.h
index 94dbac016..7b27aa27e 100644
--- a/src/machine/machine.h
+++ b/src/machine/machine.h
@@ -26,7 +26,6 @@ typedef struct MachineOperation MachineOperation;
typedef enum KillWho KillWho;
#include "list.h"
-#include "util.h"
#include "machined.h"
typedef enum MachineState {
diff --git a/src/machine/machinectl.c b/src/machine/machinectl.c
index 55cd85428..61183a6bf 100644
--- a/src/machine/machinectl.c
+++ b/src/machine/machinectl.c
@@ -24,7 +24,6 @@
#include <errno.h>
#include <string.h>
#include <getopt.h>
-#include <pwd.h>
#include <locale.h>
#include <fcntl.h>
#include <netinet/in.h>
diff --git a/src/machine/machined-dbus.c b/src/machine/machined-dbus.c
index 7a9ac2f34..0e5a494f8 100644
--- a/src/machine/machined-dbus.c
+++ b/src/machine/machined-dbus.c
@@ -22,21 +22,12 @@
#include <errno.h>
#include <string.h>
#include <unistd.h>
-#include <pwd.h>
#include "sd-id128.h"
-#include "sd-messages.h"
-#include "strv.h"
-#include "mkdir.h"
#include "path-util.h"
-#include "special.h"
-#include "fileio-label.h"
-#include "label.h"
-#include "utf8.h"
#include "unit-name.h"
#include "bus-util.h"
#include "bus-common-errors.h"
-#include "time-util.h"
#include "cgroup-util.h"
#include "machine-image.h"
#include "image-dbus.h"
diff --git a/src/machine/machined.c b/src/machine/machined.c
index 1373362e9..f91f06713 100644
--- a/src/machine/machined.c
+++ b/src/machine/machined.c
@@ -20,17 +20,11 @@
***/
#include <errno.h>
-#include <pwd.h>
-#include <fcntl.h>
#include <string.h>
#include <unistd.h>
-#include <sys/epoll.h>
#include "sd-daemon.h"
-#include "strv.h"
-#include "conf-parser.h"
#include "cgroup-util.h"
-#include "mkdir.h"
#include "bus-util.h"
#include "bus-error.h"
#include "label.h"
diff --git a/src/machine/machined.h b/src/machine/machined.h
index df0cb82f8..0f3df17d7 100644
--- a/src/machine/machined.h
+++ b/src/machine/machined.h
@@ -22,9 +22,7 @@
***/
#include <stdbool.h>
-#include <inttypes.h>
-#include "util.h"
#include "list.h"
#include "hashmap.h"
#include "sd-event.h"
diff --git a/src/modules-load/modules-load.c b/src/modules-load/modules-load.c
index 5f678789c..76e940336 100644
--- a/src/modules-load/modules-load.c
+++ b/src/modules-load/modules-load.c
@@ -19,13 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <unistd.h>
-#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <sys/stat.h>
#include <limits.h>
-#include <dirent.h>
#include <getopt.h>
#include <libkmod.h>
@@ -33,7 +30,6 @@
#include "util.h"
#include "strv.h"
#include "conf-files.h"
-#include "fileio.h"
#include "build.h"
static char **arg_proc_cmdline_modules = NULL;
diff --git a/src/network/networkd-address-pool.c b/src/network/networkd-address-pool.c
index 7ad11c617..584a956a7 100644
--- a/src/network/networkd-address-pool.c
+++ b/src/network/networkd-address-pool.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <arpa/inet.h>
#include "networkd.h"
#include "networkd-link.h"
diff --git a/src/network/networkd-address.c b/src/network/networkd-address.c
index 47033acde..255ff7702 100644
--- a/src/network/networkd-address.c
+++ b/src/network/networkd-address.c
@@ -25,7 +25,6 @@
#include "util.h"
#include "conf-parser.h"
#include "fw-util.h"
-#include "network-internal.h"
#include "networkd.h"
#include "networkd-link.h"
diff --git a/src/network/networkd-fdb.c b/src/network/networkd-fdb.c
index feab8d421..b6b8327b2 100644
--- a/src/network/networkd-fdb.c
+++ b/src/network/networkd-fdb.c
@@ -19,16 +19,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <ctype.h>
#include <net/if.h>
#include <net/ethernet.h>
#include "networkd.h"
-#include "networkd-netdev.h"
#include "networkd-link.h"
-#include "network-internal.h"
-#include "path-util.h"
-#include "conf-files.h"
#include "conf-parser.h"
#include "util.h"
diff --git a/src/network/networkd-link.c b/src/network/networkd-link.c
index f716e8231..0665e1fcf 100644
--- a/src/network/networkd-link.c
+++ b/src/network/networkd-link.c
@@ -28,12 +28,9 @@
#include "fileio.h"
#include "bus-util.h"
#include "udev-util.h"
-#include "libudev-private.h"
#include "network-internal.h"
#include "networkd-link.h"
#include "networkd-netdev.h"
-#include "conf-parser.h"
-#include "dhcp-lease-internal.h"
bool link_dhcp6_enabled(Link *link) {
if (link->flags & IFF_LOOPBACK)
diff --git a/src/network/networkd-manager.c b/src/network/networkd-manager.c
index ce97ac077..cffae835f 100644
--- a/src/network/networkd-manager.c
+++ b/src/network/networkd-manager.c
@@ -27,13 +27,11 @@
#include "networkd.h"
#include "networkd-netdev.h"
#include "networkd-link.h"
-#include "network-internal.h"
#include "libudev-private.h"
#include "udev-util.h"
#include "rtnl-util.h"
#include "bus-util.h"
#include "def.h"
-#include "mkdir.h"
#include "virt.h"
#include "sd-rtnl.h"
diff --git a/src/network/networkd-netdev-bond.c b/src/network/networkd-netdev-bond.c
index 88321ef84..c9115516f 100644
--- a/src/network/networkd-netdev-bond.c
+++ b/src/network/networkd-netdev-bond.c
@@ -21,7 +21,6 @@
***/
#include <netinet/ether.h>
-#include <arpa/inet.h>
#include <linux/if_bonding.h>
#include "conf-parser.h"
diff --git a/src/network/networkd-netdev-bridge.c b/src/network/networkd-netdev-bridge.c
index 91b7051a0..fd6af7e99 100644
--- a/src/network/networkd-netdev-bridge.c
+++ b/src/network/networkd-netdev-bridge.c
@@ -20,11 +20,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <netinet/ether.h>
-#include <arpa/inet.h>
-#include <net/if.h>
-#include "sd-rtnl.h"
#include "networkd-netdev-bridge.h"
#include "missing.h"
diff --git a/src/network/networkd-netdev-dummy.c b/src/network/networkd-netdev-dummy.c
index 01c10a2d7..bb246a2be 100644
--- a/src/network/networkd-netdev-dummy.c
+++ b/src/network/networkd-netdev-dummy.c
@@ -20,12 +20,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <netinet/ether.h>
-#include <arpa/inet.h>
-#include <net/if.h>
-#include <linux/veth.h>
-#include "sd-rtnl.h"
#include "networkd-netdev-dummy.h"
const NetDevVTable dummy_vtable = {
diff --git a/src/network/networkd-netdev-ipvlan.c b/src/network/networkd-netdev-ipvlan.c
index 9a7c280c6..5189000c1 100644
--- a/src/network/networkd-netdev-ipvlan.c
+++ b/src/network/networkd-netdev-ipvlan.c
@@ -20,12 +20,9 @@
***/
#include <net/if.h>
-#include <linux/if_link.h>
#include "networkd-netdev-ipvlan.h"
-#include "network-internal.h"
#include "conf-parser.h"
-#include "list.h"
static const char* const ipvlan_mode_table[_NETDEV_IPVLAN_MODE_MAX] = {
[NETDEV_IPVLAN_MODE_L2] = "L2",
diff --git a/src/network/networkd-netdev-macvlan.c b/src/network/networkd-netdev-macvlan.c
index 198fb575e..5f41f1c86 100644
--- a/src/network/networkd-netdev-macvlan.c
+++ b/src/network/networkd-netdev-macvlan.c
@@ -22,9 +22,7 @@
#include <net/if.h>
#include "networkd-netdev-macvlan.h"
-#include "network-internal.h"
#include "conf-parser.h"
-#include "list.h"
static const char* const macvlan_mode_table[_NETDEV_MACVLAN_MODE_MAX] = {
[NETDEV_MACVLAN_MODE_PRIVATE] = "private",
diff --git a/src/network/networkd-netdev-tunnel.c b/src/network/networkd-netdev-tunnel.c
index e95082d11..89ad3ee04 100644
--- a/src/network/networkd-netdev-tunnel.c
+++ b/src/network/networkd-netdev-tunnel.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <netinet/ether.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <linux/ip.h>
@@ -29,7 +28,6 @@
#include "sd-rtnl.h"
#include "networkd-netdev-tunnel.h"
#include "networkd-link.h"
-#include "network-internal.h"
#include "util.h"
#include "missing.h"
#include "conf-parser.h"
diff --git a/src/network/networkd-netdev-veth.c b/src/network/networkd-netdev-veth.c
index 251cf92ae..9e9e1225e 100644
--- a/src/network/networkd-netdev-veth.c
+++ b/src/network/networkd-netdev-veth.c
@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <netinet/ether.h>
-#include <arpa/inet.h>
#include <net/if.h>
#include <linux/veth.h>
diff --git a/src/network/networkd-netdev-vlan.c b/src/network/networkd-netdev-vlan.c
index 665559f89..0ed024b41 100644
--- a/src/network/networkd-netdev-vlan.c
+++ b/src/network/networkd-netdev-vlan.c
@@ -22,8 +22,6 @@
#include <net/if.h>
#include "networkd-netdev-vlan.h"
-#include "network-internal.h"
-#include "list.h"
static int netdev_vlan_fill_message_create(NetDev *netdev, Link *link, sd_rtnl_message *req) {
VLan *v = VLAN(netdev);
diff --git a/src/network/networkd-netdev-vxlan.c b/src/network/networkd-netdev-vxlan.c
index d5128cb7c..4a3a51104 100644
--- a/src/network/networkd-netdev-vxlan.c
+++ b/src/network/networkd-netdev-vxlan.c
@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <netinet/ether.h>
-#include <arpa/inet.h>
#include <net/if.h>
#include "sd-rtnl.h"
diff --git a/src/network/networkd-netdev.c b/src/network/networkd-netdev.c
index 8119205dd..3d7cc7345 100644
--- a/src/network/networkd-netdev.c
+++ b/src/network/networkd-netdev.c
@@ -24,7 +24,6 @@
#include "networkd-netdev.h"
#include "networkd-link.h"
#include "network-internal.h"
-#include "path-util.h"
#include "conf-files.h"
#include "conf-parser.h"
#include "list.h"
diff --git a/src/network/networkd-netdev.h b/src/network/networkd-netdev.h
index 3756b1e5a..7fd83964a 100644
--- a/src/network/networkd-netdev.h
+++ b/src/network/networkd-netdev.h
@@ -22,10 +22,7 @@
#pragma once
#include "networkd.h"
-#include "hashmap.h"
#include "list.h"
-#include "set.h"
-#include "in-addr-util.h"
typedef struct NetDevVTable NetDevVTable;
diff --git a/src/network/networkd-network-bus.c b/src/network/networkd-network-bus.c
index 36b40d32b..b5f8f5cfb 100644
--- a/src/network/networkd-network-bus.c
+++ b/src/network/networkd-network-bus.c
@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "bus-util.h"
-#include "bus-label.h"
#include "strv.h"
#include "networkd.h"
diff --git a/src/network/networkd-network.c b/src/network/networkd-network.c
index 35ac064cf..c6cf00a5e 100644
--- a/src/network/networkd-network.c
+++ b/src/network/networkd-network.c
@@ -22,7 +22,6 @@
#include <ctype.h>
#include <net/if.h>
-#include "path-util.h"
#include "conf-files.h"
#include "conf-parser.h"
#include "util.h"
diff --git a/src/network/networkd-route.c b/src/network/networkd-route.c
index c2d1ffca2..7f110a521 100644
--- a/src/network/networkd-route.c
+++ b/src/network/networkd-route.c
@@ -19,15 +19,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <net/if.h>
#include "networkd.h"
#include "networkd-link.h"
-#include "utf8.h"
#include "util.h"
#include "conf-parser.h"
-#include "network-internal.h"
int route_new_static(Network *network, unsigned section, Route **ret) {
_cleanup_route_free_ Route *route = NULL;
diff --git a/src/network/networkd-wait-online-link.c b/src/network/networkd-wait-online-link.c
index e091b20ed..341bcae3f 100644
--- a/src/network/networkd-wait-online-link.c
+++ b/src/network/networkd-wait-online-link.c
@@ -20,10 +20,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <net/if.h>
#include "sd-network.h"
-#include "strv.h"
#include "networkd-wait-online-link.h"
diff --git a/src/network/networkd-wait-online-manager.c b/src/network/networkd-wait-online-manager.c
index cafe110e5..1c997a50a 100644
--- a/src/network/networkd-wait-online-manager.c
+++ b/src/network/networkd-wait-online-manager.c
@@ -25,7 +25,6 @@
#include "rtnl-util.h"
-#include "network-util.h"
#include "network-internal.h"
#include "networkd-wait-online-link.h"
#include "networkd-wait-online.h"
diff --git a/src/network/networkd-wait-online.h b/src/network/networkd-wait-online.h
index 66b865cfe..73d129699 100644
--- a/src/network/networkd-wait-online.h
+++ b/src/network/networkd-wait-online.h
@@ -25,7 +25,6 @@
#include "sd-rtnl.h"
#include "sd-network.h"
-#include "util.h"
#include "hashmap.h"
typedef struct Manager Manager;
diff --git a/src/network/networkd.c b/src/network/networkd.c
index 7319276c5..723d10547 100644
--- a/src/network/networkd.c
+++ b/src/network/networkd.c
@@ -20,7 +20,6 @@
***/
#include "capability.h"
-#include "sd-event.h"
#include "sd-daemon.h"
#include "networkd.h"
diff --git a/src/network/test-network-tables.c b/src/network/test-network-tables.c
index 6709ab095..67fcca2ac 100644
--- a/src/network/test-network-tables.c
+++ b/src/network/test-network-tables.c
@@ -1,5 +1,4 @@
#include "networkd.h"
-#include "networkd-link.h"
#include "networkd-netdev-bond.h"
#include "networkd-netdev-macvlan.h"
#include "dhcp6-internal.h"
diff --git a/src/notify/notify.c b/src/notify/notify.c
index f98075d51..a8ffbe9c8 100644
--- a/src/notify/notify.c
+++ b/src/notify/notify.c
@@ -24,7 +24,6 @@
#include <errno.h>
#include <unistd.h>
#include <stdlib.h>
-#include <string.h>
#include "systemd/sd-daemon.h"
diff --git a/src/nspawn/nspawn.c b/src/nspawn/nspawn.c
index a9b9a3e06..08bfdcf4e 100644
--- a/src/nspawn/nspawn.c
+++ b/src/nspawn/nspawn.c
@@ -23,27 +23,21 @@
#include <sched.h>
#include <unistd.h>
#include <sys/types.h>
-#include <sys/syscall.h>
#include <sys/mount.h>
-#include <sys/wait.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <errno.h>
#include <sys/prctl.h>
#include <getopt.h>
-#include <termios.h>
-#include <sys/signalfd.h>
#include <grp.h>
#include <linux/fs.h>
-#include <sys/un.h>
#include <sys/socket.h>
#include <linux/netlink.h>
#include <net/if.h>
#include <linux/veth.h>
#include <sys/personality.h>
#include <linux/loop.h>
-#include <poll.h>
#include <sys/file.h>
#ifdef HAVE_SELINUX
@@ -66,7 +60,6 @@
#include "util.h"
#include "mkdir.h"
#include "macro.h"
-#include "audit.h"
#include "missing.h"
#include "cgroup-util.h"
#include "strv.h"
@@ -79,9 +72,7 @@
#include "bus-util.h"
#include "bus-error.h"
#include "ptyfwd.h"
-#include "bus-kernel.h"
#include "env-util.h"
-#include "def.h"
#include "rtnl-util.h"
#include "udev-util.h"
#include "blkid-util.h"
diff --git a/src/nss-myhostname/nss-myhostname.c b/src/nss-myhostname/nss-myhostname.c
index a939bb267..fed76c62e 100644
--- a/src/nss-myhostname/nss-myhostname.c
+++ b/src/nss-myhostname/nss-myhostname.c
@@ -19,16 +19,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <limits.h>
#include <nss.h>
-#include <sys/types.h>
#include <netdb.h>
#include <errno.h>
#include <string.h>
-#include <unistd.h>
#include <net/if.h>
#include <stdlib.h>
-#include <arpa/inet.h>
#include "local-addresses.h"
#include "macro.h"
diff --git a/src/nss-resolve/nss-resolve.c b/src/nss-resolve/nss-resolve.c
index 3f32ed065..bc6c5dc2a 100644
--- a/src/nss-resolve/nss-resolve.c
+++ b/src/nss-resolve/nss-resolve.c
@@ -19,16 +19,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <limits.h>
#include <nss.h>
-#include <sys/types.h>
#include <netdb.h>
#include <errno.h>
#include <string.h>
-#include <unistd.h>
-#include <net/if.h>
#include <stdlib.h>
-#include <arpa/inet.h>
#include <dlfcn.h>
#include "sd-bus.h"
diff --git a/src/path/path.c b/src/path/path.c
index 2f0148f07..99a4f2f3c 100644
--- a/src/path/path.c
+++ b/src/path/path.c
@@ -22,9 +22,7 @@
#include <stdio.h>
#include <getopt.h>
#include <errno.h>
-#include <unistd.h>
#include <stdlib.h>
-#include <string.h>
#include "sd-path.h"
#include "build.h"
diff --git a/src/quotacheck/quotacheck.c b/src/quotacheck/quotacheck.c
index 9ae3abd99..819706a72 100644
--- a/src/quotacheck/quotacheck.c
+++ b/src/quotacheck/quotacheck.c
@@ -21,12 +21,10 @@
#include <stdio.h>
#include <stdbool.h>
-#include <string.h>
#include <errno.h>
#include <unistd.h>
#include "util.h"
-#include "fileio.h"
static bool arg_skip = false;
static bool arg_force = false;
diff --git a/src/remount-fs/remount-fs.c b/src/remount-fs/remount-fs.c
index 57b47021e..70dacfafc 100644
--- a/src/remount-fs/remount-fs.c
+++ b/src/remount-fs/remount-fs.c
@@ -20,7 +20,6 @@
***/
#include <unistd.h>
-#include <fcntl.h>
#include <errno.h>
#include <string.h>
#include <sys/stat.h>
@@ -30,7 +29,6 @@
#include "log.h"
#include "util.h"
#include "path-util.h"
-#include "set.h"
#include "mount-setup.h"
#include "exit-status.h"
diff --git a/src/reply-password/reply-password.c b/src/reply-password/reply-password.c
index abf5f525d..d0d61b98e 100644
--- a/src/reply-password/reply-password.c
+++ b/src/reply-password/reply-password.c
@@ -20,17 +20,9 @@
***/
#include <sys/socket.h>
-#include <poll.h>
-#include <sys/types.h>
-#include <assert.h>
#include <string.h>
#include <errno.h>
-#include <unistd.h>
-#include <fcntl.h>
#include <sys/un.h>
-#include <sys/stat.h>
-#include <sys/signalfd.h>
-#include <getopt.h>
#include <stddef.h>
#include "log.h"
diff --git a/src/resolve-host/resolve-host.c b/src/resolve-host/resolve-host.c
index 43ecf81ef..068756cab 100644
--- a/src/resolve-host/resolve-host.c
+++ b/src/resolve-host/resolve-host.c
@@ -19,14 +19,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <arpa/inet.h>
#include <net/if.h>
#include <getopt.h>
#include "sd-bus.h"
#include "bus-util.h"
#include "bus-error.h"
-#include "bus-common-errors.h"
#include "in-addr-util.h"
#include "af-list.h"
#include "build.h"
diff --git a/src/resolve/resolved-dns-cache.h b/src/resolve/resolved-dns-cache.h
index e92280c31..8a9b3d459 100644
--- a/src/resolve/resolved-dns-cache.h
+++ b/src/resolve/resolved-dns-cache.h
@@ -21,7 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
#include "hashmap.h"
#include "prioq.h"
diff --git a/src/resolve/resolved-dns-domain.h b/src/resolve/resolved-dns-domain.h
index 36f27ea03..516d244f7 100644
--- a/src/resolve/resolved-dns-domain.h
+++ b/src/resolve/resolved-dns-domain.h
@@ -21,7 +21,6 @@
#pragma once
-#include <sys/types.h>
#include "hashmap.h"
#include "in-addr-util.h"
diff --git a/src/resolve/resolved-dns-packet.h b/src/resolve/resolved-dns-packet.h
index 561dd3adf..c5867386c 100644
--- a/src/resolve/resolved-dns-packet.h
+++ b/src/resolve/resolved-dns-packet.h
@@ -21,7 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <inttypes.h>
#include "macro.h"
#include "sparse-endian.h"
diff --git a/src/resolve/resolved-dns-query.c b/src/resolve/resolved-dns-query.c
index f0483c980..d619fae72 100644
--- a/src/resolve/resolved-dns-query.c
+++ b/src/resolve/resolved-dns-query.c
@@ -19,10 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "af-list.h"
#include "resolved-dns-query.h"
-#include "resolved-dns-domain.h"
/* How long to wait for the query in total */
#define QUERY_TIMEOUT_USEC (30 * USEC_PER_SEC)
diff --git a/src/resolve/resolved-dns-query.h b/src/resolve/resolved-dns-query.h
index 13b3ee4f8..788992e67 100644
--- a/src/resolve/resolved-dns-query.h
+++ b/src/resolve/resolved-dns-query.h
@@ -21,21 +21,15 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <inttypes.h>
#include "sd-bus.h"
-#include "util.h"
#include "set.h"
typedef struct DnsQuery DnsQuery;
-#include "resolved-dns-scope.h"
-#include "resolved-dns-rr.h"
#include "resolved-dns-question.h"
#include "resolved-dns-answer.h"
#include "resolved-dns-stream.h"
-#include "resolved-dns-transaction.h"
-#include "resolved-manager.h"
struct DnsQuery {
Manager *manager;
diff --git a/src/resolve/resolved-dns-rr.h b/src/resolve/resolved-dns-rr.h
index 9d9a89d38..26796c842 100644
--- a/src/resolve/resolved-dns-rr.h
+++ b/src/resolve/resolved-dns-rr.h
@@ -21,10 +21,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <inttypes.h>
#include <netinet/in.h>
-#include "util.h"
#include "hashmap.h"
#include "in-addr-util.h"
#include "dns-type.h"
diff --git a/src/resolve/resolved-dns-scope.h b/src/resolve/resolved-dns-scope.h
index f05648e5a..cfbde1343 100644
--- a/src/resolve/resolved-dns-scope.h
+++ b/src/resolve/resolved-dns-scope.h
@@ -27,11 +27,8 @@ typedef struct DnsScope DnsScope;
#include "resolved-dns-server.h"
#include "resolved-dns-packet.h"
-#include "resolved-dns-query.h"
#include "resolved-dns-cache.h"
#include "resolved-dns-zone.h"
-#include "resolved-dns-stream.h"
-#include "resolved-manager.h"
#include "resolved-link.h"
typedef enum DnsScopeMatch {
diff --git a/src/resolve/resolved-dns-server.h b/src/resolve/resolved-dns-server.h
index a438a2776..70ff35b08 100644
--- a/src/resolve/resolved-dns-server.h
+++ b/src/resolve/resolved-dns-server.h
@@ -32,7 +32,6 @@ typedef enum DnsServerType {
DNS_SERVER_LINK,
} DnsServerType;
-#include "resolved-manager.h"
#include "resolved-link.h"
struct DnsServer {
diff --git a/src/resolve/resolved-dns-stream.h b/src/resolve/resolved-dns-stream.h
index 46eae31c6..fb81e9f1a 100644
--- a/src/resolve/resolved-dns-stream.h
+++ b/src/resolve/resolved-dns-stream.h
@@ -27,7 +27,6 @@ typedef struct DnsStream DnsStream;
#include "resolved-dns-packet.h"
#include "resolved-dns-transaction.h"
-#include "resolved-manager.h"
struct DnsStream {
Manager *manager;
diff --git a/src/resolve/resolved-dns-transaction.h b/src/resolve/resolved-dns-transaction.h
index 182fb7714..f6d539d31 100644
--- a/src/resolve/resolved-dns-transaction.h
+++ b/src/resolve/resolved-dns-transaction.h
@@ -40,11 +40,9 @@ enum DnsTransactionState {
};
#include "resolved-dns-scope.h"
-#include "resolved-dns-rr.h"
#include "resolved-dns-packet.h"
#include "resolved-dns-question.h"
#include "resolved-dns-answer.h"
-#include "resolved-dns-stream.h"
struct DnsTransaction {
DnsScope *scope;
diff --git a/src/resolve/resolved-link.h b/src/resolve/resolved-link.h
index 4f0702e87..eee184610 100644
--- a/src/resolve/resolved-link.h
+++ b/src/resolve/resolved-link.h
@@ -29,8 +29,6 @@
typedef struct Link Link;
typedef struct LinkAddress LinkAddress;
-#include "resolved-dns-server.h"
-#include "resolved-dns-scope.h"
#include "resolved-dns-rr.h"
#include "resolved-manager.h"
diff --git a/src/resolve/resolved-manager.c b/src/resolve/resolved-manager.c
index b5ad70161..167bea39b 100644
--- a/src/resolve/resolved-manager.c
+++ b/src/resolve/resolved-manager.c
@@ -19,18 +19,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <arpa/inet.h>
#include <resolv.h>
-#include <net/if.h>
#include <sys/ioctl.h>
#include <poll.h>
#include <netinet/in.h>
#include "rtnl-util.h"
-#include "event-util.h"
-#include "network-util.h"
#include "network-internal.h"
-#include "conf-parser.h"
#include "socket-util.h"
#include "af-list.h"
#include "utf8.h"
diff --git a/src/resolve/resolved-manager.h b/src/resolve/resolved-manager.h
index 1151029d2..5a581cc13 100644
--- a/src/resolve/resolved-manager.h
+++ b/src/resolve/resolved-manager.h
@@ -24,9 +24,7 @@
#include "sd-event.h"
#include "sd-network.h"
#include "sd-rtnl.h"
-#include "util.h"
#include "list.h"
-#include "in-addr-util.h"
#include "hashmap.h"
typedef struct Manager Manager;
@@ -41,8 +39,6 @@ enum Support {
};
#include "resolved-dns-query.h"
-#include "resolved-dns-server.h"
-#include "resolved-dns-scope.h"
#include "resolved-dns-stream.h"
#include "resolved-link.h"
diff --git a/src/resolve/resolved.c b/src/resolve/resolved.c
index ce15a8011..271247ca3 100644
--- a/src/resolve/resolved.c
+++ b/src/resolve/resolved.c
@@ -22,7 +22,6 @@
#include "sd-event.h"
#include "sd-daemon.h"
#include "mkdir.h"
-#include "label.h"
#include "capability.h"
#include "selinux-util.h"
diff --git a/src/resolve/test-dns-domain.c b/src/resolve/test-dns-domain.c
index ebc8d98fc..2f3edaf78 100644
--- a/src/resolve/test-dns-domain.c
+++ b/src/resolve/test-dns-domain.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "log.h"
#include "macro.h"
#include "resolved-dns-domain.h"
diff --git a/src/shared/acl-util.c b/src/shared/acl-util.c
index a4ff1ab87..34707e6b3 100644
--- a/src/shared/acl-util.c
+++ b/src/shared/acl-util.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <errno.h>
#include <stdbool.h>
diff --git a/src/shared/acpi-fpdt.c b/src/shared/acpi-fpdt.c
index 390c3236e..64e50401b 100644
--- a/src/shared/acpi-fpdt.c
+++ b/src/shared/acpi-fpdt.c
@@ -19,13 +19,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
-#include <sys/types.h>
#include <util.h>
#include <fileio.h>
diff --git a/src/shared/apparmor-util.c b/src/shared/apparmor-util.c
index c14843da4..c2bbd330b 100644
--- a/src/shared/apparmor-util.c
+++ b/src/shared/apparmor-util.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <unistd.h>
#include "util.h"
#include "fileio.h"
diff --git a/src/shared/arphrd-list.c b/src/shared/arphrd-list.c
index 6e113eff7..284043cd9 100644
--- a/src/shared/arphrd-list.c
+++ b/src/shared/arphrd-list.c
@@ -20,7 +20,6 @@
***/
#include <net/if_arp.h>
-#include <sys/socket.h>
#include <string.h>
#include "util.h"
diff --git a/src/shared/ask-password-api.h b/src/shared/ask-password-api.h
index 704ee6e1b..0954e072b 100644
--- a/src/shared/ask-password-api.h
+++ b/src/shared/ask-password-api.h
@@ -21,7 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "util.h"
int ask_password_tty(const char *message, usec_t until, bool echo, const char *flag_file, char **_passphrase);
diff --git a/src/shared/audit.c b/src/shared/audit.c
index 4701c0a8d..4c1496f60 100644
--- a/src/shared/audit.c
+++ b/src/shared/audit.c
@@ -19,20 +19,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
-#include <string.h>
-#include <unistd.h>
#include <errno.h>
-#include <stdlib.h>
#include <stdio.h>
-#include <ctype.h>
#include "macro.h"
#include "audit.h"
#include "util.h"
-#include "log.h"
#include "fileio.h"
-#include "virt.h"
int audit_session_from_pid(pid_t pid, uint32_t *id) {
_cleanup_free_ char *s = NULL;
diff --git a/src/shared/audit.h b/src/shared/audit.h
index b4aecffb3..7e9c929ac 100644
--- a/src/shared/audit.h
+++ b/src/shared/audit.h
@@ -23,7 +23,6 @@
#include <sys/types.h>
-#include "capability.h"
int audit_session_from_pid(pid_t pid, uint32_t *id);
int audit_loginuid_from_pid(pid_t pid, uid_t *uid);
diff --git a/src/shared/barrier.c b/src/shared/barrier.c
index f65363a67..ec121d740 100644
--- a/src/shared/barrier.c
+++ b/src/shared/barrier.c
@@ -21,13 +21,10 @@
#include <errno.h>
#include <fcntl.h>
-#include <limits.h>
#include <poll.h>
#include <stdbool.h>
#include <stdint.h>
-#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <sys/eventfd.h>
#include <sys/types.h>
#include <unistd.h>
diff --git a/src/shared/barrier.h b/src/shared/barrier.h
index d4ad2a419..7816fae57 100644
--- a/src/shared/barrier.h
+++ b/src/shared/barrier.h
@@ -21,14 +21,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <errno.h>
-#include <inttypes.h>
-#include <stdlib.h>
-#include <string.h>
#include <sys/types.h>
#include "macro.h"
-#include "util.h"
/* See source file for an API description. */
diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c
index 73907c635..6bd317f35 100644
--- a/src/shared/base-filesystem.c
+++ b/src/shared/base-filesystem.c
@@ -22,17 +22,12 @@
#include <errno.h>
#include <sys/stat.h>
#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
#include <unistd.h>
#include "base-filesystem.h"
#include "log.h"
#include "macro.h"
-#include "strv.h"
#include "util.h"
-#include "label.h"
-#include "mkdir.h"
typedef struct BaseFilesystem {
const char *dir;
diff --git a/src/shared/boot-timestamps.c b/src/shared/boot-timestamps.c
index 54e0537a2..68419595f 100644
--- a/src/shared/boot-timestamps.c
+++ b/src/shared/boot-timestamps.c
@@ -19,7 +19,6 @@
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <unistd.h>
#include "boot-timestamps.h"
#include "acpi-fpdt.h"
diff --git a/src/shared/btrfs-util.c b/src/shared/btrfs-util.c
index b34ac8b15..2a70dfea4 100644
--- a/src/shared/btrfs-util.c
+++ b/src/shared/btrfs-util.c
@@ -31,7 +31,6 @@
#include "util.h"
#include "path-util.h"
#include "macro.h"
-#include "strv.h"
#include "copy.h"
#include "selinux-util.h"
#include "smack-util.h"
diff --git a/src/shared/bus-label.c b/src/shared/bus-label.c
index 61eb75bca..9e9eaf400 100644
--- a/src/shared/bus-label.c
+++ b/src/shared/bus-label.c
@@ -19,13 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <stdlib.h>
-#include <unistd.h>
#include "util.h"
#include "macro.h"
-#include "def.h"
#include "bus-label.h"
diff --git a/src/shared/cap-list.c b/src/shared/cap-list.c
index 8033e8c7b..bd5bffbfa 100644
--- a/src/shared/cap-list.c
+++ b/src/shared/cap-list.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <linux/capability.h>
#include <string.h>
#include "util.h"
diff --git a/src/shared/capability.c b/src/shared/capability.c
index 915ceb9d9..4840c3ebf 100644
--- a/src/shared/capability.c
+++ b/src/shared/capability.c
@@ -19,14 +19,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
-#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
-#include <sys/types.h>
-#include <stdarg.h>
-#include <ctype.h>
#include <sys/capability.h>
#include <sys/prctl.h>
#include "grp.h"
diff --git a/src/shared/capability.h b/src/shared/capability.h
index 6f2f6f997..8260ae1a8 100644
--- a/src/shared/capability.h
+++ b/src/shared/capability.h
@@ -21,7 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <inttypes.h>
#include <stdbool.h>
#include <sys/capability.h>
diff --git a/src/shared/cgroup-show.h b/src/shared/cgroup-show.h
index 3146f56ca..aa832454b 100644
--- a/src/shared/cgroup-show.h
+++ b/src/shared/cgroup-show.h
@@ -23,7 +23,6 @@
#include <stdbool.h>
#include <sys/types.h>
-#include "util.h"
#include "logs-show.h"
int show_cgroup_by_path(const char *path, const char *prefix, unsigned columns, bool kernel_threads, OutputFlags flags);
diff --git a/src/shared/cgroup-util.c b/src/shared/cgroup-util.c
index dfd8689b7..05c3125ae 100644
--- a/src/shared/cgroup-util.c
+++ b/src/shared/cgroup-util.c
@@ -30,12 +30,10 @@
#include <ftw.h>
#include "cgroup-util.h"
-#include "log.h"
#include "set.h"
#include "macro.h"
#include "util.h"
#include "path-util.h"
-#include "strv.h"
#include "unit-name.h"
#include "fileio.h"
#include "special.h"
diff --git a/src/shared/clean-ipc.c b/src/shared/clean-ipc.c
index 39ab64513..ea781f5de 100644
--- a/src/shared/clean-ipc.c
+++ b/src/shared/clean-ipc.c
@@ -24,7 +24,6 @@
#include <sys/sem.h>
#include <sys/msg.h>
#include <sys/stat.h>
-#include <sys/mman.h>
#include <fcntl.h>
#include <dirent.h>
#include <mqueue.h>
diff --git a/src/shared/clock-util.c b/src/shared/clock-util.c
index 96684681a..e4e03df1e 100644
--- a/src/shared/clock-util.c
+++ b/src/shared/clock-util.c
@@ -19,29 +19,16 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
-#include <string.h>
-#include <unistd.h>
#include <errno.h>
-#include <stdlib.h>
-#include <signal.h>
#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
-#include <stdarg.h>
-#include <ctype.h>
-#include <sys/prctl.h>
#include <sys/time.h>
#include <linux/rtc.h>
#include "macro.h"
#include "util.h"
-#include "log.h"
-#include "strv.h"
#include "clock-util.h"
-#include "fileio.h"
int clock_get_hwclock(struct tm *tm) {
_cleanup_close_ int fd = -1;
diff --git a/src/shared/clock-util.h b/src/shared/clock-util.h
index 198a7b275..8c2d23543 100644
--- a/src/shared/clock-util.h
+++ b/src/shared/clock-util.h
@@ -21,7 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "util.h"
int clock_is_localtime(void);
int clock_set_timezone(int *min);
diff --git a/src/shared/condition.c b/src/shared/condition.c
index da7560f05..f34b45f2a 100644
--- a/src/shared/condition.c
+++ b/src/shared/condition.c
@@ -23,14 +23,12 @@
#include <errno.h>
#include <string.h>
#include <unistd.h>
-#include <sys/statvfs.h>
#include <fnmatch.h>
#include "sd-id128.h"
#include "util.h"
#include "virt.h"
#include "path-util.h"
-#include "fileio.h"
#include "architecture.h"
#include "smack-util.h"
#include "apparmor-util.h"
diff --git a/src/shared/conf-files.c b/src/shared/conf-files.c
index db4937db8..9ab08355e 100644
--- a/src/shared/conf-files.c
+++ b/src/shared/conf-files.c
@@ -19,13 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <string.h>
-#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
-#include <sys/stat.h>
#include <dirent.h>
#include "macro.h"
diff --git a/src/shared/conf-files.h b/src/shared/conf-files.h
index 368c112eb..3169a907f 100644
--- a/src/shared/conf-files.h
+++ b/src/shared/conf-files.h
@@ -22,7 +22,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "macro.h"
int conf_files_list(char ***strv, const char *suffix, const char *root, const char *dir, ...);
int conf_files_list_strv(char ***strv, const char *suffix, const char *root, const char* const* dirs);
diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c
index 0b1af6c57..2148a30c6 100644
--- a/src/shared/conf-parser.c
+++ b/src/shared/conf-parser.c
@@ -22,9 +22,7 @@
#include <string.h>
#include <stdio.h>
#include <errno.h>
-#include <assert.h>
#include <stdlib.h>
-#include <netinet/ether.h>
#include "conf-parser.h"
#include "conf-files.h"
@@ -34,8 +32,6 @@
#include "log.h"
#include "utf8.h"
#include "path-util.h"
-#include "set.h"
-#include "exit-status.h"
#include "sd-messages.h"
int log_syntax_internal(
diff --git a/src/shared/dev-setup.c b/src/shared/dev-setup.c
index e8b0810d2..cb15da8a5 100644
--- a/src/shared/dev-setup.c
+++ b/src/shared/dev-setup.c
@@ -20,15 +20,10 @@
***/
#include <errno.h>
-#include <sys/stat.h>
#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
#include <unistd.h>
#include "dev-setup.h"
-#include "log.h"
-#include "macro.h"
#include "util.h"
#include "label.h"
diff --git a/src/shared/device-nodes.c b/src/shared/device-nodes.c
index 73e9edd29..8751797f5 100644
--- a/src/shared/device-nodes.c
+++ b/src/shared/device-nodes.c
@@ -19,10 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdlib.h>
#include <stdio.h>
-#include <stdint.h>
-#include <sys/types.h>
#include "device-nodes.h"
#include "utf8.h"
diff --git a/src/shared/efivars.c b/src/shared/efivars.c
index 5b3c5f09c..4f8a81dcd 100644
--- a/src/shared/efivars.c
+++ b/src/shared/efivars.c
@@ -22,9 +22,7 @@
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
-#include <ctype.h>
-#include "acpi-fpdt.h"
#include "util.h"
#include "utf8.h"
#include "efivars.h"
diff --git a/src/shared/efivars.h b/src/shared/efivars.h
index 82364565b..249289371 100644
--- a/src/shared/efivars.h
+++ b/src/shared/efivars.h
@@ -21,8 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
-#include <inttypes.h>
#include <stdbool.h>
#include "sd-id128.h"
diff --git a/src/shared/env-util.c b/src/shared/env-util.c
index 038246d21..00c2cdd8c 100644
--- a/src/shared/env-util.c
+++ b/src/shared/env-util.c
@@ -20,7 +20,6 @@
***/
#include <limits.h>
-#include <sys/param.h>
#include <unistd.h>
#include "strv.h"
diff --git a/src/shared/env-util.h b/src/shared/env-util.h
index 618441a65..9de362171 100644
--- a/src/shared/env-util.h
+++ b/src/shared/env-util.h
@@ -22,7 +22,6 @@
***/
#include <stdbool.h>
-#include <sys/types.h>
#include "macro.h"
diff --git a/src/shared/errno-list.c b/src/shared/errno-list.c
index c63296f29..34d133148 100644
--- a/src/shared/errno-list.c
+++ b/src/shared/errno-list.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <errno.h>
#include <string.h>
#include "util.h"
diff --git a/src/shared/exit-status.c b/src/shared/exit-status.c
index 5c73b4d3c..57022c5b8 100644
--- a/src/shared/exit-status.c
+++ b/src/shared/exit-status.c
@@ -20,7 +20,6 @@
***/
#include <stdlib.h>
-#include <sys/wait.h>
#include "exit-status.h"
#include "set.h"
diff --git a/src/shared/fdset.c b/src/shared/fdset.c
index 9e35ce5ce..31849272b 100644
--- a/src/shared/fdset.c
+++ b/src/shared/fdset.c
@@ -22,7 +22,6 @@
#include <errno.h>
#include <dirent.h>
#include <fcntl.h>
-#include <unistd.h>
#include "set.h"
#include "util.h"
diff --git a/src/shared/fdset.h b/src/shared/fdset.h
index c3c5e5228..340438d7c 100644
--- a/src/shared/fdset.h
+++ b/src/shared/fdset.h
@@ -22,7 +22,6 @@
***/
#include "set.h"
-#include "util.h"
typedef struct FDSet FDSet;
diff --git a/src/shared/fileio-label.c b/src/shared/fileio-label.c
index 5fd69e058..bec988ca7 100644
--- a/src/shared/fileio-label.c
+++ b/src/shared/fileio-label.c
@@ -19,13 +19,9 @@
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
#include "util.h"
#include "selinux-util.h"
-#include "label.h"
#include "fileio-label.h"
int write_string_file_atomic_label(const char *fn, const char *line) {
diff --git a/src/shared/generator.c b/src/shared/generator.c
index 7f16d5cbe..569b25bb7 100644
--- a/src/shared/generator.c
+++ b/src/shared/generator.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <string.h>
#include <unistd.h>
#include "util.h"
diff --git a/src/shared/hashmap.c b/src/shared/hashmap.c
index e63ba4bb5..48d750239 100644
--- a/src/shared/hashmap.c
+++ b/src/shared/hashmap.c
@@ -20,9 +20,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <stdlib.h>
-#include <string.h>
#include <errno.h>
#include "util.h"
@@ -31,9 +29,12 @@
#include "macro.h"
#include "siphash24.h"
#include "strv.h"
-#include "list.h"
#include "mempool.h"
+#ifdef ENABLE_DEBUG_HASHMAP
+#include "list.h"
+#endif
+
/*
* Implementation of hashmaps.
* Addressing: open
diff --git a/src/shared/install-printf.c b/src/shared/install-printf.c
index d853f1777..f62a0321e 100644
--- a/src/shared/install-printf.c
+++ b/src/shared/install-printf.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <stdlib.h>
#include "specifier.h"
diff --git a/src/shared/install.c b/src/shared/install.c
index 65f1c245c..95ba71855 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -36,7 +36,6 @@
#include "install.h"
#include "conf-parser.h"
#include "conf-files.h"
-#include "specifier.h"
#include "install-printf.h"
#include "special.h"
diff --git a/src/shared/json.c b/src/shared/json.c
index bb3d26f0e..45c8ecedb 100644
--- a/src/shared/json.c
+++ b/src/shared/json.c
@@ -23,7 +23,6 @@
#include <math.h>
#include "macro.h"
-#include "log.h"
#include "util.h"
#include "utf8.h"
#include "json.h"
diff --git a/src/shared/json.h b/src/shared/json.h
index a8457132e..55976d513 100644
--- a/src/shared/json.h
+++ b/src/shared/json.h
@@ -22,7 +22,6 @@
***/
#include <stdbool.h>
-#include <inttypes.h>
enum {
JSON_END,
diff --git a/src/shared/log.h b/src/shared/log.h
index b323b2f7d..2dedfa3fd 100644
--- a/src/shared/log.h
+++ b/src/shared/log.h
@@ -25,8 +25,6 @@
#include <stdarg.h>
#include <syslog.h>
#include <sys/signalfd.h>
-#include <sys/types.h>
-#include <unistd.h>
#include <errno.h>
#include "macro.h"
diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c
index c2495056d..944d6856c 100644
--- a/src/shared/logs-show.c
+++ b/src/shared/logs-show.c
@@ -20,9 +20,7 @@
***/
#include <time.h>
-#include <assert.h>
#include <errno.h>
-#include <poll.h>
#include <sys/socket.h>
#include <string.h>
#include <fcntl.h>
@@ -32,7 +30,6 @@
#include "util.h"
#include "utf8.h"
#include "hashmap.h"
-#include "fileio.h"
#include "journal-internal.h"
/* up to three lines (each up to 100 characters),
diff --git a/src/shared/logs-show.h b/src/shared/logs-show.h
index 8d9641e8a..569e1faa5 100644
--- a/src/shared/logs-show.h
+++ b/src/shared/logs-show.h
@@ -22,7 +22,6 @@
***/
#include <stdbool.h>
-#include <unistd.h>
#include <sys/types.h>
#include "sd-journal.h"
diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c
index 8d61507e8..c734f148a 100644
--- a/src/shared/machine-image.c
+++ b/src/shared/machine-image.c
@@ -23,7 +23,6 @@
#include <linux/fs.h>
#include <fcntl.h>
-#include "strv.h"
#include "utf8.h"
#include "btrfs-util.h"
#include "path-util.h"
diff --git a/src/shared/memfd-util.c b/src/shared/memfd-util.c
index 6624c5e7d..e99a738e1 100644
--- a/src/shared/memfd-util.c
+++ b/src/shared/memfd-util.c
@@ -21,7 +21,6 @@
#include <stdio.h>
#include <fcntl.h>
-#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/prctl.h>
@@ -30,7 +29,6 @@
#endif
#include "util.h"
-#include "bus-label.h"
#include "memfd-util.h"
#include "utf8.h"
#include "missing.h"
diff --git a/src/shared/memfd-util.h b/src/shared/memfd-util.h
index cf588fe02..3ed551fb3 100644
--- a/src/shared/memfd-util.h
+++ b/src/shared/memfd-util.h
@@ -21,12 +21,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <inttypes.h>
-#include <sys/types.h>
-#include <stdio.h>
-#include "macro.h"
-#include "util.h"
int memfd_new(const char *name);
int memfd_new_and_map(const char *name, size_t sz, void **p);
diff --git a/src/shared/mkdir-label.c b/src/shared/mkdir-label.c
index ee11ac06f..76bbc1edd 100644
--- a/src/shared/mkdir-label.c
+++ b/src/shared/mkdir-label.c
@@ -20,16 +20,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
-#include <string.h>
#include <unistd.h>
-#include <errno.h>
-#include <stdlib.h>
#include <stdio.h>
#include "label.h"
-#include "util.h"
-#include "path-util.h"
#include "mkdir.h"
int mkdir_safe_label(const char *path, mode_t mode, uid_t uid, gid_t gid) {
diff --git a/src/shared/mkdir.c b/src/shared/mkdir.c
index beefd1052..b280618a9 100644
--- a/src/shared/mkdir.c
+++ b/src/shared/mkdir.c
@@ -19,14 +19,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <string.h>
-#include <unistd.h>
#include <errno.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include "label.h"
#include "util.h"
#include "path-util.h"
#include "mkdir.h"
diff --git a/src/shared/mkdir.h b/src/shared/mkdir.h
index e317df300..2392d1fd1 100644
--- a/src/shared/mkdir.h
+++ b/src/shared/mkdir.h
@@ -22,7 +22,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdbool.h>
#include <sys/types.h>
int mkdir_safe(const char *path, mode_t mode, uid_t uid, gid_t gid);
diff --git a/src/shared/pager.c b/src/shared/pager.c
index 8635d9a60..f12bfb328 100644
--- a/src/shared/pager.c
+++ b/src/shared/pager.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/src/shared/path-lookup.c b/src/shared/path-lookup.c
index 291a2f405..fbf46cd40 100644
--- a/src/shared/path-lookup.c
+++ b/src/shared/path-lookup.c
@@ -19,15 +19,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <unistd.h>
#include <errno.h>
#include "util.h"
-#include "mkdir.h"
#include "strv.h"
#include "path-util.h"
#include "path-lookup.h"
diff --git a/src/shared/path-util.c b/src/shared/path-util.c
index 70bc1caa2..12d1ec321 100644
--- a/src/shared/path-util.c
+++ b/src/shared/path-util.c
@@ -19,15 +19,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
-#include <signal.h>
#include <stdio.h>
#include <fcntl.h>
-#include <dirent.h>
#include <sys/statvfs.h>
#include "macro.h"
diff --git a/src/shared/pty.c b/src/shared/pty.c
index fbe6295ea..0f80f4863 100644
--- a/src/shared/pty.c
+++ b/src/shared/pty.c
@@ -44,18 +44,12 @@
#include <errno.h>
#include <fcntl.h>
-#include <limits.h>
-#include <linux/ioctl.h>
#include <signal.h>
#include <stdbool.h>
#include <stdint.h>
-#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <sys/epoll.h>
-#include <sys/eventfd.h>
#include <sys/ioctl.h>
-#include <sys/types.h>
#include <sys/uio.h>
#include <sys/wait.h>
#include <termios.h>
diff --git a/src/shared/pty.h b/src/shared/pty.h
index a87ceb58c..63c7db283 100644
--- a/src/shared/pty.h
+++ b/src/shared/pty.h
@@ -21,17 +21,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <errno.h>
#include <stdbool.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
#include "barrier.h"
#include "macro.h"
#include "sd-event.h"
-#include "util.h"
typedef struct Pty Pty;
diff --git a/src/shared/ptyfwd.c b/src/shared/ptyfwd.c
index 164c9b6ff..9d4d61cef 100644
--- a/src/shared/ptyfwd.c
+++ b/src/shared/ptyfwd.c
@@ -20,7 +20,6 @@
***/
#include <sys/epoll.h>
-#include <sys/signalfd.h>
#include <sys/ioctl.h>
#include <limits.h>
#include <termios.h>
diff --git a/src/shared/ptyfwd.h b/src/shared/ptyfwd.h
index 6208a543d..6f84e4036 100644
--- a/src/shared/ptyfwd.h
+++ b/src/shared/ptyfwd.h
@@ -21,11 +21,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
-#include <signal.h>
#include <stdbool.h>
-#include "util.h"
#include "sd-event.h"
typedef struct PTYForward PTYForward;
diff --git a/src/shared/ratelimit.c b/src/shared/ratelimit.c
index 01b62b7b3..81fc9c19f 100644
--- a/src/shared/ratelimit.c
+++ b/src/shared/ratelimit.c
@@ -19,10 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include "ratelimit.h"
-#include "log.h"
/* Modelled after Linux' lib/ratelimit.c by Dave Young
* <hidave.darkstar@gmail.com>, which is licensed GPLv2. */
diff --git a/src/shared/ring.c b/src/shared/ring.c
index 309075e34..681491846 100644
--- a/src/shared/ring.c
+++ b/src/shared/ring.c
@@ -20,7 +20,6 @@
***/
#include <errno.h>
-#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <sys/uio.h>
diff --git a/src/shared/ring.h b/src/shared/ring.h
index 1210aabdf..a7c44d1b5 100644
--- a/src/shared/ring.h
+++ b/src/shared/ring.h
@@ -21,11 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <errno.h>
-#include <inttypes.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/uio.h>
typedef struct Ring Ring;
diff --git a/src/shared/selinux-util.c b/src/shared/selinux-util.c
index a2233e0cf..82c6924e3 100644
--- a/src/shared/selinux-util.c
+++ b/src/shared/selinux-util.c
@@ -20,7 +20,6 @@
***/
#include <errno.h>
-#include <unistd.h>
#include <malloc.h>
#include <sys/un.h>
diff --git a/src/shared/selinux-util.h b/src/shared/selinux-util.h
index a69444100..846718529 100644
--- a/src/shared/selinux-util.h
+++ b/src/shared/selinux-util.h
@@ -22,7 +22,6 @@
***/
#include <sys/socket.h>
-#include <stdio.h>
#include <stdbool.h>
bool mac_selinux_use(void);
diff --git a/src/shared/socket-label.c b/src/shared/socket-label.c
index 6806c5115..dfb8a1a43 100644
--- a/src/shared/socket-label.c
+++ b/src/shared/socket-label.c
@@ -19,24 +19,16 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
-#include <stdlib.h>
-#include <arpa/inet.h>
-#include <stdio.h>
-#include <net/if.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <stddef.h>
-#include <sys/ioctl.h>
#include "macro.h"
#include "util.h"
#include "mkdir.h"
#include "missing.h"
-#include "label.h"
#include "selinux-util.h"
#include "socket-util.h"
diff --git a/src/shared/socket-util.c b/src/shared/socket-util.c
index a4e26b1d8..74d90fa2a 100644
--- a/src/shared/socket-util.c
+++ b/src/shared/socket-util.c
@@ -19,24 +19,19 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
-#include <stdlib.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <net/if.h>
#include <sys/types.h>
-#include <sys/stat.h>
#include <stddef.h>
-#include <sys/ioctl.h>
#include <netdb.h>
#include "macro.h"
-#include "util.h"
-#include "mkdir.h"
#include "path-util.h"
+#include "util.h"
#include "socket-util.h"
#include "missing.h"
#include "fileio.h"
diff --git a/src/shared/socket-util.h b/src/shared/socket-util.h
index 07d0aff72..2d2b90236 100644
--- a/src/shared/socket-util.h
+++ b/src/shared/socket-util.h
@@ -25,7 +25,6 @@
#include <netinet/in.h>
#include <netinet/ether.h>
#include <sys/un.h>
-#include <asm/types.h>
#include <linux/netlink.h>
#include <linux/if_packet.h>
diff --git a/src/shared/spawn-ask-password-agent.c b/src/shared/spawn-ask-password-agent.c
index ee267833e..0d7458806 100644
--- a/src/shared/spawn-ask-password-agent.c
+++ b/src/shared/spawn-ask-password-agent.c
@@ -19,13 +19,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
-#include <string.h>
-#include <sys/prctl.h>
#include <signal.h>
-#include <fcntl.h>
#include "log.h"
#include "util.h"
diff --git a/src/shared/spawn-polkit-agent.c b/src/shared/spawn-polkit-agent.c
index 8f259a8f3..bc1810da9 100644
--- a/src/shared/spawn-polkit-agent.c
+++ b/src/shared/spawn-polkit-agent.c
@@ -19,13 +19,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
-#include <string.h>
-#include <sys/prctl.h>
#include <signal.h>
-#include <fcntl.h>
#include <errno.h>
#include <poll.h>
diff --git a/src/shared/strbuf.h b/src/shared/strbuf.h
index 2347fd432..fbc4e5f2a 100644
--- a/src/shared/strbuf.h
+++ b/src/shared/strbuf.h
@@ -21,9 +21,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdarg.h>
#include <stdint.h>
-#include <stdbool.h>
struct strbuf {
char *buf;
diff --git a/src/shared/strv.c b/src/shared/strv.c
index e27ac6815..ee45ad1d0 100644
--- a/src/shared/strv.c
+++ b/src/shared/strv.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
diff --git a/src/shared/strxcpyx.h b/src/shared/strxcpyx.h
index 7be246d57..ccc7e52f3 100644
--- a/src/shared/strxcpyx.h
+++ b/src/shared/strxcpyx.h
@@ -21,8 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdarg.h>
-#include <stdbool.h>
#include "macro.h"
diff --git a/src/shared/time-dst.c b/src/shared/time-dst.c
index 1ce6f721b..2797d1a79 100644
--- a/src/shared/time-dst.c
+++ b/src/shared/time-dst.c
@@ -21,18 +21,12 @@
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <ctype.h>
#include <errno.h>
#include <stddef.h>
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <endian.h>
-#include <byteswap.h>
-#include <assert.h>
-#include <limits.h>
-#include <unistd.h>
#include <stdint.h>
#include <stdbool.h>
#include <sys/stat.h>
diff --git a/src/shared/unit-name.c b/src/shared/unit-name.c
index 21b66913c..0cc06f4f8 100644
--- a/src/shared/unit-name.c
+++ b/src/shared/unit-name.c
@@ -21,7 +21,6 @@
#include <errno.h>
#include <string.h>
-#include <assert.h>
#include "path-util.h"
#include "bus-label.h"
diff --git a/src/shared/util.c b/src/shared/util.c
index dc6528013..241e7520b 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
@@ -48,7 +47,6 @@
#include <pwd.h>
#include <netinet/ip.h>
#include <linux/kd.h>
-#include <dlfcn.h>
#include <sys/wait.h>
#include <sys/time.h>
#include <glob.h>
@@ -83,7 +81,6 @@
#include "missing.h"
#include "log.h"
#include "strv.h"
-#include "label.h"
#include "mkdir.h"
#include "path-util.h"
#include "exit-status.h"
diff --git a/src/shared/util.h b/src/shared/util.h
index 759d053c2..a9235536b 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -25,7 +25,6 @@
#include <fcntl.h>
#include <inttypes.h>
#include <time.h>
-#include <sys/time.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
@@ -36,12 +35,10 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
-#include <sys/resource.h>
#include <stddef.h>
#include <unistd.h>
#include <locale.h>
#include <mntent.h>
-#include <sys/socket.h>
#include <sys/inotify.h>
#if SIZEOF_PID_T == 4
diff --git a/src/shared/utmp-wtmp.c b/src/shared/utmp-wtmp.c
index bdb962af3..7fb6fe3a6 100644
--- a/src/shared/utmp-wtmp.c
+++ b/src/shared/utmp-wtmp.c
@@ -21,7 +21,6 @@
#include <utmpx.h>
#include <errno.h>
-#include <assert.h>
#include <string.h>
#include <sys/utsname.h>
#include <fcntl.h>
diff --git a/src/shutdownd/shutdownd.c b/src/shutdownd/shutdownd.c
index 60a646878..6e4511ece 100644
--- a/src/shutdownd/shutdownd.c
+++ b/src/shutdownd/shutdownd.c
@@ -21,13 +21,9 @@
#include <sys/socket.h>
#include <poll.h>
-#include <sys/types.h>
#include <sys/timerfd.h>
-#include <assert.h>
-#include <string.h>
#include <errno.h>
#include <unistd.h>
-#include <fcntl.h>
#include <stddef.h>
#include "systemd/sd-daemon.h"
diff --git a/src/sleep/sleep.c b/src/sleep/sleep.c
index cc1ffa63f..eee6bc898 100644
--- a/src/sleep/sleep.c
+++ b/src/sleep/sleep.c
@@ -22,10 +22,8 @@
#include <stdio.h>
#include <errno.h>
-#include <string.h>
#include <getopt.h>
-#include "sd-id128.h"
#include "sd-messages.h"
#include "log.h"
#include "util.h"
diff --git a/src/socket-proxy/socket-proxyd.c b/src/socket-proxy/socket-proxyd.c
index a3c3c87f1..715f440cb 100644
--- a/src/socket-proxy/socket-proxyd.c
+++ b/src/socket-proxy/socket-proxyd.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <arpa/inet.h>
#include <errno.h>
#include <getopt.h>
#include <stdio.h>
@@ -37,7 +36,6 @@
#include "log.h"
#include "socket-util.h"
#include "util.h"
-#include "event-util.h"
#include "build.h"
#include "set.h"
#include "path-util.h"
diff --git a/src/system-update-generator/system-update-generator.c b/src/system-update-generator/system-update-generator.c
index ad34ef136..00045150f 100644
--- a/src/system-update-generator/system-update-generator.c
+++ b/src/system-update-generator/system-update-generator.c
@@ -24,8 +24,6 @@
#include "log.h"
#include "util.h"
-#include "unit-name.h"
-#include "path-util.h"
/*
* Implements the logic described in
diff --git a/src/systemctl/systemctl.c b/src/systemctl/systemctl.c
index 9b083131d..4e90f6862 100644
--- a/src/systemctl/systemctl.c
+++ b/src/systemctl/systemctl.c
@@ -22,21 +22,16 @@
#include <sys/reboot.h>
#include <linux/reboot.h>
-#include <sys/syscall.h>
#include <stdio.h>
#include <getopt.h>
#include <locale.h>
#include <stdbool.h>
#include <string.h>
#include <errno.h>
-#include <sys/ioctl.h>
-#include <termios.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/socket.h>
-#include <sys/stat.h>
#include <stddef.h>
-#include <sys/prctl.h>
#include "sd-daemon.h"
#include "sd-shutdown.h"
@@ -55,7 +50,6 @@
#include "cgroup-util.h"
#include "list.h"
#include "path-lookup.h"
-#include "conf-parser.h"
#include "exit-status.h"
#include "build.h"
#include "unit-name.h"
diff --git a/src/sysusers/sysusers.c b/src/sysusers/sysusers.c
index e47bcb4dc..0b5668a33 100644
--- a/src/sysusers/sysusers.c
+++ b/src/sysusers/sysusers.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
#include <pwd.h>
#include <grp.h>
#include <shadow.h>
@@ -36,7 +35,6 @@
#include "conf-files.h"
#include "copy.h"
#include "utf8.h"
-#include "label.h"
#include "fileio-label.h"
#include "uid-range.h"
#include "selinux-util.h"
diff --git a/src/sysv-generator/sysv-generator.c b/src/sysv-generator/sysv-generator.c
index bd67f321f..25b10c1a4 100644
--- a/src/sysv-generator/sysv-generator.c
+++ b/src/sysv-generator/sysv-generator.c
@@ -34,10 +34,6 @@
#include "unit.h"
#include "unit-name.h"
#include "special.h"
-#include "exit-status.h"
-#include "def.h"
-#include "env-util.h"
-#include "fileio.h"
#include "hashmap.h"
typedef enum RunlevelType {
diff --git a/src/test/test-barrier.c b/src/test/test-barrier.c
index cb75f7314..2d109a30e 100644
--- a/src/test/test-barrier.c
+++ b/src/test/test-barrier.c
@@ -28,15 +28,12 @@
* increase it at the slightly cost of lengthen test-duration on other machines.
*/
-#include <errno.h>
#include <stdio.h>
-#include <string.h>
#include <sys/time.h>
#include <sys/wait.h>
#include <unistd.h>
#include "barrier.h"
-#include "def.h"
#include "util.h"
/* 20ms to test deadlocks; All timings use multiples of this constant as
diff --git a/src/test/test-btrfs.c b/src/test/test-btrfs.c
index 150a32ad6..c49b83217 100644
--- a/src/test/test-btrfs.c
+++ b/src/test/test-btrfs.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdlib.h>
#include <fcntl.h>
#include "log.h"
diff --git a/src/test/test-cap-list.c b/src/test/test-cap-list.c
index 632d62ff8..43a2d35b8 100644
--- a/src/test/test-cap-list.c
+++ b/src/test/test-cap-list.c
@@ -20,7 +20,6 @@
***/
#include "util.h"
-#include "log.h"
#include "fileio.h"
#include "cap-list.h"
#include "capability.h"
diff --git a/src/test/test-capability.c b/src/test/test-capability.c
index 43769923b..f47452ce7 100644
--- a/src/test/test-capability.c
+++ b/src/test/test-capability.c
@@ -17,7 +17,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
#include <sys/wait.h>
#include <sys/capability.h>
#include <sys/socket.h>
diff --git a/src/test/test-cgroup-mask.c b/src/test/test-cgroup-mask.c
index 9e9de23e0..d14a07e1f 100644
--- a/src/test/test-cgroup-mask.c
+++ b/src/test/test-cgroup-mask.c
@@ -20,14 +20,9 @@
***/
#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/types.h>
-#include <pwd.h>
#include "manager.h"
#include "unit.h"
-#include "util.h"
#include "macro.h"
#include "test-helper.h"
diff --git a/src/test/test-cgroup-util.c b/src/test/test-cgroup-util.c
index 67eeeb56b..9834a6a13 100644
--- a/src/test/test-cgroup-util.c
+++ b/src/test/test-cgroup-util.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include "util.h"
#include "cgroup-util.h"
diff --git a/src/test/test-cgroup.c b/src/test/test-cgroup.c
index 46642f92f..4be69a408 100644
--- a/src/test/test-cgroup.c
+++ b/src/test/test-cgroup.c
@@ -25,7 +25,6 @@
#include "cgroup-util.h"
#include "path-util.h"
#include "util.h"
-#include "log.h"
int main(int argc, char*argv[]) {
char *path;
diff --git a/src/test/test-ellipsize.c b/src/test/test-ellipsize.c
index f97c78ebd..6a2f9aa94 100644
--- a/src/test/test-ellipsize.c
+++ b/src/test/test-ellipsize.c
@@ -22,7 +22,6 @@
#include <stdio.h>
#include "util.h"
-#include "utf8.h"
#include "def.h"
static void test_one(const char *p) {
diff --git a/src/test/test-engine.c b/src/test/test-engine.c
index 456999ca4..c8d0a147a 100644
--- a/src/test/test-engine.c
+++ b/src/test/test-engine.c
@@ -22,7 +22,6 @@
#include <stdio.h>
#include <errno.h>
#include <string.h>
-#include <unistd.h>
#include "manager.h"
#include "bus-util.h"
diff --git a/src/test/test-env-replace.c b/src/test/test-env-replace.c
index 0274e9761..8f1fcd992 100644
--- a/src/test/test-env-replace.c
+++ b/src/test/test-env-replace.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <unistd.h>
#include <string.h>
#include "util.h"
diff --git a/src/test/test-execute.c b/src/test/test-execute.c
index 91ccaf72b..428fd3260 100644
--- a/src/test/test-execute.c
+++ b/src/test/test-execute.c
@@ -23,7 +23,6 @@
#include "manager.h"
#include "util.h"
#include "macro.h"
-#include "strv.h"
#include "mkdir.h"
typedef void (*test_function_t)(Manager *m);
diff --git a/src/test/test-hashmap.c b/src/test/test-hashmap.c
index 6900da9e8..40be084ff 100644
--- a/src/test/test-hashmap.c
+++ b/src/test/test-hashmap.c
@@ -17,8 +17,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <inttypes.h>
-#include "strv.h"
#include "util.h"
#include "hashmap.h"
diff --git a/src/test/test-hostname.c b/src/test/test-hostname.c
index 86efa1a3f..c7e5de896 100644
--- a/src/test/test-hostname.c
+++ b/src/test/test-hostname.c
@@ -19,10 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <errno.h>
-#include <string.h>
-#include <stdio.h>
-#include <fcntl.h>
#include "hostname-setup.h"
#include "util.h"
diff --git a/src/test/test-install.c b/src/test/test-install.c
index 467970b00..5ee52e64c 100644
--- a/src/test/test-install.c
+++ b/src/test/test-install.c
@@ -19,13 +19,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <errno.h>
#include <string.h>
#include <stdio.h>
-#include <fcntl.h>
-#include "util.h"
-#include "path-util.h"
#include "install.h"
static void dump_changes(UnitFileChange *c, unsigned n) {
diff --git a/src/test/test-job-type.c b/src/test/test-job-type.c
index 1d9d49b22..af0d76e89 100644
--- a/src/test/test-job-type.c
+++ b/src/test/test-job-type.c
@@ -20,9 +20,6 @@
***/
#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#include <unistd.h>
#include "job.h"
#include "unit.h"
diff --git a/src/test/test-json.c b/src/test/test-json.c
index b09131891..24dc7003b 100644
--- a/src/test/test-json.c
+++ b/src/test/test-json.c
@@ -21,7 +21,6 @@
#include <math.h>
-#include "log.h"
#include "util.h"
#include "json.h"
diff --git a/src/test/test-libudev.c b/src/test/test-libudev.c
index 293c151d4..2b004fdfb 100644
--- a/src/test/test-libudev.c
+++ b/src/test/test-libudev.c
@@ -19,13 +19,8 @@
***/
#include <stdio.h>
-#include <stdarg.h>
-#include <stdlib.h>
#include <unistd.h>
-#include <errno.h>
-#include <string.h>
#include <getopt.h>
-#include <fcntl.h>
#include <sys/epoll.h>
#include "libudev.h"
diff --git a/src/test/test-locale-util.c b/src/test/test-locale-util.c
index 1398a3a0b..976507536 100644
--- a/src/test/test-locale-util.c
+++ b/src/test/test-locale-util.c
@@ -17,7 +17,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <unistd.h>
#include "locale-util.h"
#include "strv.h"
diff --git a/src/test/test-loopback.c b/src/test/test-loopback.c
index 75fe053b6..c03bda438 100644
--- a/src/test/test-loopback.c
+++ b/src/test/test-loopback.c
@@ -19,14 +19,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <errno.h>
#include <string.h>
#include <stdio.h>
-#include <fcntl.h>
#include "loopback-setup.h"
#include "log.h"
-#include "util.h"
int main(int argc, char* argv[]) {
int r;
diff --git a/src/test/test-ns.c b/src/test/test-ns.c
index 7cd7b7715..76b131c28 100644
--- a/src/test/test-ns.c
+++ b/src/test/test-ns.c
@@ -20,13 +20,9 @@
***/
#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
-#include <sys/mount.h>
-#include <linux/fs.h>
#include "namespace.h"
-#include "execute.h"
#include "log.h"
int main(int argc, char *argv[]) {
diff --git a/src/test/test-path-lookup.c b/src/test/test-path-lookup.c
index 38e5c93df..a951b01b9 100644
--- a/src/test/test-path-lookup.c
+++ b/src/test/test-path-lookup.c
@@ -20,7 +20,6 @@
***/
#include <sys/stat.h>
-#include <sys/types.h>
#include "path-lookup.h"
#include "log.h"
diff --git a/src/test/test-pty.c b/src/test/test-pty.c
index cab569a9d..eadecb99a 100644
--- a/src/test/test-pty.c
+++ b/src/test/test-pty.c
@@ -20,13 +20,11 @@
***/
#include <errno.h>
-#include <fcntl.h>
#include <locale.h>
#include <string.h>
#include <sys/wait.h>
#include <unistd.h>
-#include "def.h"
#include "pty.h"
#include "util.h"
diff --git a/src/test/test-ring.c b/src/test/test-ring.c
index a9dd01ca0..cb8a5d4e9 100644
--- a/src/test/test-ring.c
+++ b/src/test/test-ring.c
@@ -20,14 +20,9 @@
***/
#include <string.h>
-#include <unistd.h>
-#include <fcntl.h>
-#include <locale.h>
-#include <errno.h>
#include "def.h"
#include "ring.h"
-#include "util.h"
static void test_ring(void) {
static const char buf[8192];
diff --git a/src/test/test-rtnl-manual.c b/src/test/test-rtnl-manual.c
index c8133dbad..c406454f7 100644
--- a/src/test/test-rtnl-manual.c
+++ b/src/test/test-rtnl-manual.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <netinet/ether.h>
#include <arpa/inet.h>
#include <net/if.h>
#include <linux/ip.h>
@@ -29,10 +28,6 @@
#include "util.h"
#include "macro.h"
#include "sd-rtnl.h"
-#include "socket-util.h"
-#include "rtnl-util.h"
-#include "event-util.h"
-#include "rtnl-internal.h"
static int load_module(const char *mod_name) {
struct kmod_ctx *ctx;
diff --git a/src/test/test-set.c b/src/test/test-set.c
index e280c8952..ac292ed68 100644
--- a/src/test/test-set.c
+++ b/src/test/test-set.c
@@ -17,7 +17,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "util.h"
#include "set.h"
static void test_set_steal_first(void) {
diff --git a/src/test/test-sleep.c b/src/test/test-sleep.c
index a1020ad14..1d75d05a8 100644
--- a/src/test/test-sleep.c
+++ b/src/test/test-sleep.c
@@ -19,10 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <errno.h>
-#include <string.h>
#include <stdio.h>
-#include <fcntl.h>
#include "util.h"
#include "log.h"
diff --git a/src/test/test-strxcpyx.c b/src/test/test-strxcpyx.c
index a7c8e1267..858a4081d 100644
--- a/src/test/test-strxcpyx.c
+++ b/src/test/test-strxcpyx.c
@@ -22,7 +22,6 @@
#include <string.h>
#include "util.h"
-#include "strv.h"
#include "strxcpyx.h"
static void test_strpcpy(void) {
diff --git a/src/test/test-tables.c b/src/test/test-tables.c
index bda224bec..0e5ab1645 100644
--- a/src/test/test-tables.c
+++ b/src/test/test-tables.c
@@ -23,14 +23,12 @@
#include "condition.h"
#include "device.h"
#include "execute.h"
-#include "exit-status.h"
#include "install.h"
#include "job.h"
#include "kill.h"
#include "log.h"
#include "logs-show.h"
#include "mount.h"
-#include "path-lookup.h"
#include "path.h"
#include "scope.h"
#include "service.h"
diff --git a/src/test/test-tmpfiles.c b/src/test/test-tmpfiles.c
index 4b72c4a8f..90e49d454 100644
--- a/src/test/test-tmpfiles.c
+++ b/src/test/test-tmpfiles.c
@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
#include <unistd.h>
#include <stdlib.h>
diff --git a/src/test/test-udev.c b/src/test/test-udev.c
index b57d275ef..4403624c5 100644
--- a/src/test/test-udev.c
+++ b/src/test/test-udev.c
@@ -19,14 +19,9 @@
***/
#include <stdio.h>
-#include <stddef.h>
#include <stdlib.h>
-#include <string.h>
-#include <fcntl.h>
-#include <ctype.h>
#include <errno.h>
#include <unistd.h>
-#include <grp.h>
#include <sched.h>
#include <sys/mount.h>
#include <sys/signalfd.h>
diff --git a/src/test/test-unit-file.c b/src/test/test-unit-file.c
index e517f571d..22ac76de5 100644
--- a/src/test/test-unit-file.c
+++ b/src/test/test-unit-file.c
@@ -20,7 +20,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <stdio.h>
#include <stddef.h>
#include <string.h>
diff --git a/src/test/test-unit-name.c b/src/test/test-unit-name.c
index 5c7f8b40f..7d882aebd 100644
--- a/src/test/test-unit-name.c
+++ b/src/test/test-unit-name.c
@@ -24,14 +24,12 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
-#include <sys/types.h>
#include <pwd.h>
#include "manager.h"
#include "unit.h"
#include "unit-name.h"
#include "unit-printf.h"
-#include "install.h"
#include "specifier.h"
#include "util.h"
#include "macro.h"
diff --git a/src/test/test-watchdog.c b/src/test/test-watchdog.c
index f6bb045c3..2e5d0c3aa 100644
--- a/src/test/test-watchdog.c
+++ b/src/test/test-watchdog.c
@@ -20,7 +20,6 @@
***/
#include <unistd.h>
-#include <string.h>
#include "watchdog.h"
#include "log.h"
diff --git a/src/timedate/timedatectl.c b/src/timedate/timedatectl.c
index 4d8988673..9e04f8f7b 100644
--- a/src/timedate/timedatectl.c
+++ b/src/timedate/timedatectl.c
@@ -22,11 +22,8 @@
#include <stdlib.h>
#include <stdbool.h>
-#include <unistd.h>
#include <getopt.h>
#include <locale.h>
-#include <string.h>
-#include <sys/timex.h>
#include "sd-bus.h"
#include "bus-util.h"
diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
index 23efe832a..18dcd18b0 100644
--- a/src/timedate/timedated.c
+++ b/src/timedate/timedated.c
@@ -23,7 +23,6 @@
#include <string.h>
#include <unistd.h>
-#include "sd-id128.h"
#include "sd-messages.h"
#include "sd-event.h"
#include "sd-bus.h"
@@ -32,10 +31,8 @@
#include "strv.h"
#include "def.h"
#include "clock-util.h"
-#include "conf-files.h"
#include "path-util.h"
#include "fileio-label.h"
-#include "label.h"
#include "bus-util.h"
#include "bus-error.h"
#include "bus-common-errors.h"
diff --git a/src/timesync/timesyncd-conf.c b/src/timesync/timesyncd-conf.c
index be1f4bb15..df4d89a62 100644
--- a/src/timesync/timesyncd-conf.c
+++ b/src/timesync/timesyncd-conf.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "in-addr-util.h"
#include "timesyncd-manager.h"
#include "timesyncd-server.h"
diff --git a/src/timesync/timesyncd-manager.c b/src/timesync/timesyncd-manager.c
index 73ac7eecb..a9e91c4d6 100644
--- a/src/timesync/timesyncd-manager.c
+++ b/src/timesync/timesyncd-manager.c
@@ -21,21 +21,15 @@
#include <stdlib.h>
#include <errno.h>
-#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
#include <time.h>
#include <math.h>
-#include <arpa/inet.h>
#include <netinet/in.h>
#include <netinet/ip.h>
#include <sys/timerfd.h>
#include <sys/timex.h>
#include <sys/socket.h>
#include <resolv.h>
-#include <sys/prctl.h>
#include <sys/types.h>
-#include <grp.h>
#include "missing.h"
#include "util.h"
@@ -45,13 +39,8 @@
#include "list.h"
#include "ratelimit.h"
#include "strv.h"
-#include "conf-parser.h"
#include "sd-daemon.h"
-#include "event-util.h"
#include "network-util.h"
-#include "clock-util.h"
-#include "capability.h"
-#include "mkdir.h"
#include "timesyncd-conf.h"
#include "timesyncd-manager.h"
#include "time-util.h"
diff --git a/src/timesync/timesyncd-manager.h b/src/timesync/timesyncd-manager.h
index c7efdc5df..b1a844ba7 100644
--- a/src/timesync/timesyncd-manager.h
+++ b/src/timesync/timesyncd-manager.h
@@ -25,7 +25,6 @@
#include "sd-resolve.h"
#include "sd-network.h"
#include "list.h"
-#include "socket-util.h"
#include "ratelimit.h"
typedef struct Manager Manager;
diff --git a/src/timesync/timesyncd.c b/src/timesync/timesyncd.c
index 2a73dac03..735668bed 100644
--- a/src/timesync/timesyncd.c
+++ b/src/timesync/timesyncd.c
@@ -21,7 +21,6 @@
#include "sd-event.h"
#include "sd-daemon.h"
-#include "mkdir.h"
#include "capability.h"
#include "clock-util.h"
#include "network-util.h"
diff --git a/src/tmpfiles/tmpfiles.c b/src/tmpfiles/tmpfiles.c
index 88ba7e46a..264293414 100644
--- a/src/tmpfiles/tmpfiles.c
+++ b/src/tmpfiles/tmpfiles.c
@@ -26,8 +26,6 @@
#include <string.h>
#include <limits.h>
#include <dirent.h>
-#include <grp.h>
-#include <pwd.h>
#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
@@ -37,8 +35,6 @@
#include <glob.h>
#include <fnmatch.h>
#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/param.h>
#include <sys/xattr.h>
#include "log.h"
diff --git a/src/udev/accelerometer/accelerometer.c b/src/udev/accelerometer/accelerometer.c
index 0f1b3c6ec..9e2c590c1 100644
--- a/src/udev/accelerometer/accelerometer.c
+++ b/src/udev/accelerometer/accelerometer.c
@@ -46,16 +46,10 @@
#include <stdio.h>
#include <string.h>
-#include <stdbool.h>
#include <math.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <fcntl.h>
#include <stdlib.h>
-#include <unistd.h>
#include <getopt.h>
#include <limits.h>
-#include <linux/limits.h>
#include <linux/input.h>
#include "libudev.h"
diff --git a/src/udev/collect/collect.c b/src/udev/collect/collect.c
index 4bb6edbef..6cf41c67b 100644
--- a/src/udev/collect/collect.c
+++ b/src/udev/collect/collect.c
@@ -20,18 +20,10 @@
*/
#include <stdio.h>
-#include <stdlib.h>
#include <stddef.h>
-#include <unistd.h>
-#include <signal.h>
-#include <fcntl.h>
#include <errno.h>
-#include <string.h>
#include <getopt.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#include "libudev.h"
#include "libudev-private.h"
#include "macro.h"
diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c
index 8b3dc45d4..810a88153 100644
--- a/src/udev/net/link-config.c
+++ b/src/udev/net/link-config.c
@@ -22,7 +22,6 @@
#include <netinet/ether.h>
#include <linux/netdevice.h>
-#include "sd-id128.h"
#include "missing.h"
#include "link-config.h"
@@ -36,11 +35,8 @@
#include "path-util.h"
#include "conf-parser.h"
#include "conf-files.h"
-#include "fileio.h"
-#include "hashmap.h"
#include "rtnl-util.h"
#include "network-internal.h"
-#include "siphash24.h"
struct link_config_ctx {
LIST_HEAD(link_config, links);
diff --git a/src/udev/net/link-config.h b/src/udev/net/link-config.h
index cb434d1ae..34facdeb5 100644
--- a/src/udev/net/link-config.h
+++ b/src/udev/net/link-config.h
@@ -23,7 +23,6 @@
#include "ethtool-util.h"
#include "condition.h"
-#include "util.h"
#include "list.h"
#include "libudev.h"
diff --git a/src/udev/udev-builtin-blkid.c b/src/udev/udev-builtin-blkid.c
index 03e3dc286..f4f6900d1 100644
--- a/src/udev/udev-builtin-blkid.c
+++ b/src/udev/udev-builtin-blkid.c
@@ -20,8 +20,6 @@
#include <stdio.h>
#include <stdlib.h>
-#include <stdarg.h>
-#include <unistd.h>
#include <string.h>
#include <errno.h>
#include <fcntl.h>
diff --git a/src/udev/udev-builtin-btrfs.c b/src/udev/udev-builtin-btrfs.c
index 3643596a7..335282156 100644
--- a/src/udev/udev-builtin-btrfs.c
+++ b/src/udev/udev-builtin-btrfs.c
@@ -17,12 +17,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <unistd.h>
#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
#include <fcntl.h>
-#include <errno.h>
#include <sys/ioctl.h>
#ifdef HAVE_LINUX_BTRFS_H
diff --git a/src/udev/udev-builtin-hwdb.c b/src/udev/udev-builtin-hwdb.c
index 95476648f..5e0e7ebb1 100644
--- a/src/udev/udev-builtin-hwdb.c
+++ b/src/udev/udev-builtin-hwdb.c
@@ -18,10 +18,6 @@
***/
#include <stdio.h>
-#include <errno.h>
-#include <string.h>
-#include <inttypes.h>
-#include <ctype.h>
#include <stdlib.h>
#include <fnmatch.h>
#include <getopt.h>
diff --git a/src/udev/udev-builtin-keyboard.c b/src/udev/udev-builtin-keyboard.c
index d8ee4cbb6..8ab1be89e 100644
--- a/src/udev/udev-builtin-keyboard.c
+++ b/src/udev/udev-builtin-keyboard.c
@@ -18,19 +18,15 @@
***/
#include <stdio.h>
-#include <errno.h>
#include <string.h>
#include <stdlib.h>
-#include <fcntl.h>
#include <sys/ioctl.h>
-#include <linux/limits.h>
#include <linux/input.h>
#include "udev.h"
static const struct key *keyboard_lookup_key(const char *str, unsigned len);
#include "keyboard-keys-from-name.h"
-#include "keyboard-keys-to-name.h"
static int install_force_release(struct udev_device *dev, const unsigned *release, unsigned release_count) {
struct udev_device *atkbd;
diff --git a/src/udev/udev-builtin-kmod.c b/src/udev/udev-builtin-kmod.c
index ad2829e50..81e78a8aa 100644
--- a/src/udev/udev-builtin-kmod.c
+++ b/src/udev/udev-builtin-kmod.c
@@ -21,12 +21,7 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
-#include <unistd.h>
-#include <string.h>
#include <errno.h>
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <sys/wait.h>
#include <libkmod.h>
#include "udev.h"
diff --git a/src/udev/udev-builtin-uaccess.c b/src/udev/udev-builtin-uaccess.c
index b78c09b91..99bb91ae5 100644
--- a/src/udev/udev-builtin-uaccess.c
+++ b/src/udev/udev-builtin-uaccess.c
@@ -20,14 +20,7 @@
#include <stdio.h>
#include <stdlib.h>
-#include <stdarg.h>
-#include <unistd.h>
-#include <string.h>
-#include <ctype.h>
-#include <fcntl.h>
#include <errno.h>
-#include <dirent.h>
-#include <getopt.h>
#include "systemd/sd-login.h"
#include "logind-acl.h"
diff --git a/src/udev/udev-builtin.c b/src/udev/udev-builtin.c
index 1950ec23a..d2aec1b20 100644
--- a/src/udev/udev-builtin.c
+++ b/src/udev/udev-builtin.c
@@ -17,12 +17,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <unistd.h>
#include <stdio.h>
-#include <stdlib.h>
-#include <stddef.h>
#include <string.h>
-#include <errno.h>
#include <getopt.h>
#include "udev.h"
diff --git a/src/udev/udev-ctrl.c b/src/udev/udev-ctrl.c
index 59a3eceaa..c0c5981db 100644
--- a/src/udev/udev-ctrl.c
+++ b/src/udev/udev-ctrl.c
@@ -10,12 +10,10 @@
*/
#include <errno.h>
-#include <stdio.h>
#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <unistd.h>
-#include <sys/types.h>
#include <poll.h>
#include <sys/socket.h>
#include <sys/un.h>
diff --git a/src/udev/udev-event.c b/src/udev/udev-event.c
index bc115f112..1c5d5e9a4 100644
--- a/src/udev/udev-event.c
+++ b/src/udev/udev-event.c
@@ -23,7 +23,6 @@
#include <errno.h>
#include <ctype.h>
#include <string.h>
-#include <time.h>
#include <net/if.h>
#include <sys/prctl.h>
#include <poll.h>
diff --git a/src/udev/udev-node.c b/src/udev/udev-node.c
index 793b48469..debf9ea88 100644
--- a/src/udev/udev-node.c
+++ b/src/udev/udev-node.c
@@ -15,7 +15,6 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stddef.h>
@@ -23,11 +22,8 @@
#include <fcntl.h>
#include <unistd.h>
#include <errno.h>
-#include <grp.h>
#include <dirent.h>
-#include <sys/time.h>
#include <sys/stat.h>
-#include <sys/types.h>
#include "udev.h"
#include "smack-util.h"
diff --git a/src/udev/udev-watch.c b/src/udev/udev-watch.c
index 6ba8674d7..15b76dd6a 100644
--- a/src/udev/udev-watch.c
+++ b/src/udev/udev-watch.c
@@ -17,14 +17,10 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <sys/types.h>
#include <errno.h>
-#include <fcntl.h>
#include <stdio.h>
#include <dirent.h>
#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
#include <sys/inotify.h>
diff --git a/src/udev/udevadm-control.c b/src/udev/udevadm-control.c
index 6af7163d4..78170463b 100644
--- a/src/udev/udevadm-control.c
+++ b/src/udev/udevadm-control.c
@@ -12,7 +12,6 @@
* GNU General Public License for more details.
*/
-#include <time.h>
#include <errno.h>
#include <stdio.h>
#include <stdlib.h>
@@ -20,10 +19,6 @@
#include <string.h>
#include <unistd.h>
#include <getopt.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/wait.h>
-#include <sys/un.h>
#include "udev.h"
#include "udev-util.h"
diff --git a/src/udev/udevadm-hwdb.c b/src/udev/udevadm-hwdb.c
index d65e40c01..00609e31b 100644
--- a/src/udev/udevadm-hwdb.c
+++ b/src/udev/udevadm-hwdb.c
@@ -18,7 +18,6 @@
***/
#include <stdlib.h>
-#include <unistd.h>
#include <getopt.h>
#include <string.h>
#include <ctype.h>
diff --git a/src/udev/udevadm-info.c b/src/udev/udevadm-info.c
index 0bab01a23..352e024a7 100644
--- a/src/udev/udevadm-info.c
+++ b/src/udev/udevadm-info.c
@@ -15,19 +15,16 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <stddef.h>
#include <ctype.h>
-#include <stdarg.h>
#include <unistd.h>
#include <dirent.h>
#include <errno.h>
#include <getopt.h>
#include <fcntl.h>
#include <sys/stat.h>
-#include <sys/types.h>
#include "udev.h"
#include "udev-util.h"
diff --git a/src/udev/udevadm-monitor.c b/src/udev/udevadm-monitor.c
index 15ded0933..7ef2e6823 100644
--- a/src/udev/udevadm-monitor.c
+++ b/src/udev/udevadm-monitor.c
@@ -15,22 +15,15 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <unistd.h>
#include <stdio.h>
-#include <stdlib.h>
#include <stddef.h>
#include <string.h>
-#include <fcntl.h>
#include <errno.h>
#include <signal.h>
#include <getopt.h>
#include <time.h>
#include <sys/time.h>
-#include <sys/socket.h>
-#include <sys/un.h>
#include <sys/epoll.h>
-#include <linux/types.h>
-#include <linux/netlink.h>
#include "udev.h"
#include "udev-util.h"
diff --git a/src/udev/udevadm-settle.c b/src/udev/udevadm-settle.c
index fff5de7a8..0d3025ed1 100644
--- a/src/udev/udevadm-settle.c
+++ b/src/udev/udevadm-settle.c
@@ -23,17 +23,10 @@
#include <stdio.h>
#include <unistd.h>
#include <errno.h>
-#include <dirent.h>
-#include <fcntl.h>
#include <getopt.h>
-#include <signal.h>
-#include <time.h>
#include <poll.h>
-#include <sys/stat.h>
-#include <sys/types.h>
#include "udev.h"
-#include "udev-util.h"
#include "util.h"
static void help(void) {
diff --git a/src/udev/udevadm-test-builtin.c b/src/udev/udevadm-test-builtin.c
index baaeca935..35a734943 100644
--- a/src/udev/udevadm-test-builtin.c
+++ b/src/udev/udevadm-test-builtin.c
@@ -17,19 +17,9 @@
#include <stdlib.h>
#include <stddef.h>
-#include <string.h>
#include <stdio.h>
-#include <unistd.h>
#include <errno.h>
-#include <dirent.h>
-#include <fcntl.h>
#include <getopt.h>
-#include <signal.h>
-#include <time.h>
-#include <sys/inotify.h>
-#include <poll.h>
-#include <sys/stat.h>
-#include <sys/types.h>
#include "udev.h"
diff --git a/src/udev/udevadm-test.c b/src/udev/udevadm-test.c
index 4922b5b6a..542c56eb1 100644
--- a/src/udev/udevadm-test.c
+++ b/src/udev/udevadm-test.c
@@ -17,13 +17,10 @@
*/
#include <stdlib.h>
-#include <string.h>
#include <stdio.h>
#include <stddef.h>
#include <unistd.h>
#include <errno.h>
-#include <ctype.h>
-#include <fcntl.h>
#include <signal.h>
#include <getopt.h>
#include <sys/signalfd.h>
diff --git a/src/udev/udevadm-trigger.c b/src/udev/udevadm-trigger.c
index 4dc756a28..11e83f355 100644
--- a/src/udev/udevadm-trigger.c
+++ b/src/udev/udevadm-trigger.c
@@ -15,20 +15,13 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <stdlib.h>
#include <stddef.h>
#include <string.h>
#include <stdio.h>
#include <unistd.h>
#include <getopt.h>
#include <errno.h>
-#include <dirent.h>
#include <fcntl.h>
-#include <fnmatch.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <sys/socket.h>
-#include <sys/un.h>
#include "udev.h"
#include "udev-util.h"
diff --git a/src/udev/udevadm.c b/src/udev/udevadm.c
index 56cd0cd4e..b86d8921f 100644
--- a/src/udev/udevadm.c
+++ b/src/udev/udevadm.c
@@ -16,11 +16,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
-#include <unistd.h>
#include <stdio.h>
-#include <stdlib.h>
#include <stddef.h>
-#include <string.h>
#include <errno.h>
#include <getopt.h>
diff --git a/src/udev/udevd.c b/src/udev/udevd.c
index 99d4c8983..0556356f6 100644
--- a/src/udev/udevd.c
+++ b/src/udev/udevd.c
@@ -26,25 +26,19 @@
#include <stdlib.h>
#include <stdbool.h>
#include <string.h>
-#include <ctype.h>
#include <fcntl.h>
-#include <time.h>
#include <getopt.h>
-#include <dirent.h>
#include <sys/file.h>
#include <sys/time.h>
#include <sys/prctl.h>
#include <sys/socket.h>
-#include <sys/un.h>
#include <sys/signalfd.h>
#include <sys/epoll.h>
#include <sys/mount.h>
-#include <poll.h>
#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/ioctl.h>
#include <sys/inotify.h>
-#include <sys/utsname.h>
#include "sd-daemon.h"
#include "rtnl-util.h"
diff --git a/src/update-done/update-done.c b/src/update-done/update-done.c
index 561963e5e..44caf84fa 100644
--- a/src/update-done/update-done.c
+++ b/src/update-done/update-done.c
@@ -20,7 +20,6 @@
***/
#include "util.h"
-#include "label.h"
#include "selinux-util.h"
#define MESSAGE \
diff --git a/src/update-utmp/update-utmp.c b/src/update-utmp/update-utmp.c
index 5e7498c9e..33535ebd7 100644
--- a/src/update-utmp/update-utmp.c
+++ b/src/update-utmp/update-utmp.c
@@ -19,10 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <errno.h>
#include <string.h>
-#include <sys/types.h>
#include <unistd.h>
#ifdef HAVE_AUDIT
diff --git a/src/vconsole/vconsole-setup.c b/src/vconsole/vconsole-setup.c
index 28371711b..bf681d9f3 100644
--- a/src/vconsole/vconsole-setup.c
+++ b/src/vconsole/vconsole-setup.c
@@ -23,21 +23,16 @@
#include <unistd.h>
#include <stdlib.h>
#include <errno.h>
-#include <string.h>
#include <fcntl.h>
-#include <ctype.h>
#include <stdbool.h>
-#include <stdarg.h>
#include <limits.h>
#include <sys/ioctl.h>
-#include <sys/wait.h>
#include <linux/tiocl.h>
#include <linux/kd.h>
#include <linux/vt.h>
#include "util.h"
#include "log.h"
-#include "macro.h"
#include "virt.h"
#include "fileio.h"