summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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 2689934c40..d345e28567 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 f569109268..bfc71e3f38 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 591b4ab14e..7abe969bef 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 ad8ad659d2..2cbed293ba 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 089b7754a4..6028ed68c0 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 73450e283d..96637f12c6 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 64a384bacf..2fac30039d 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 26de0dd9f8..e4dbdd921d 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 a66387c304..607cc5e74b 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 e111fa9cce..93b4764ee7 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 b6b0056362..9645c504f5 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 f6ac0c0093..497bce7b56 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 f2ec1bbea4..8f0ab8f17f 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 bc2c0c86f3..3c613e4157 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 3dea908f5b..0c851f93c1 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 913d47071b..172bc7f569 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 9fb3e9fc49..35e69a5c01 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 e1b0fd3535..542166f68a 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 421487e038..d19d0e1b60 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 579e06de5b..c6f5485716 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 a30a2f1022..569c011dc0 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 9dd62f04a0..f82f211d42 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 927965e02c..264a4d009a 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 19d14016ad..3657dca398 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 56344ef2cf..5e9e5c7c49 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 6f65dcdcb9..26dd068f5c 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 b0db610400..f85c1a0791 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 9f6bd84b21..4a509efaf4 100644
--- a/src/core/automount.c
+++ b/src/core/automount.c
@@ -32,8 +32,6 @@
#include "unit.h"
#include "automount.h"
#include "mount.h"
-#include "load-fragment.h"
-#include "load-dropin.h"
#include "unit-name.h"
#include "special.h"
#include "label.h"
diff --git a/src/core/busname.h b/src/core/busname.h
index 775822d8de..69528a2aef 100644
--- a/src/core/busname.h
+++ b/src/core/busname.h
@@ -24,7 +24,6 @@
typedef struct BusName BusName;
typedef struct BusNamePolicy BusNamePolicy;
-#include "unit.h"
typedef enum BusNameState {
BUSNAME_DEAD,
diff --git a/src/core/cgroup.h b/src/core/cgroup.h
index 8fa851de32..993aa9db7d 100644
--- a/src/core/cgroup.h
+++ b/src/core/cgroup.h
@@ -91,7 +91,6 @@ struct CGroupContext {
};
#include "unit.h"
-#include "manager.h"
#include "cgroup-util.h"
void cgroup_context_init(CGroupContext *c);
diff --git a/src/core/dbus-automount.c b/src/core/dbus-automount.c
index b2a510ad09..38acbd0c26 100644
--- a/src/core/dbus-automount.c
+++ b/src/core/dbus-automount.c
@@ -19,9 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "unit.h"
#include "automount.h"
-#include "dbus-unit.h"
#include "dbus-automount.h"
#include "bus-util.h"
diff --git a/src/core/dbus-automount.h b/src/core/dbus-automount.h
index 1bec953788..a2b124d756 100644
--- a/src/core/dbus-automount.h
+++ b/src/core/dbus-automount.h
@@ -21,6 +21,5 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "sd-bus.h"
extern const sd_bus_vtable bus_automount_vtable[];
diff --git a/src/core/dbus-busname.c b/src/core/dbus-busname.c
index 28f192403b..b1ceb05b1a 100644
--- a/src/core/dbus-busname.c
+++ b/src/core/dbus-busname.c
@@ -21,7 +21,6 @@
#include "unit.h"
#include "busname.h"
-#include "dbus-unit.h"
#include "dbus-busname.h"
#include "bus-util.h"
diff --git a/src/core/dbus-busname.h b/src/core/dbus-busname.h
index b5eed37d58..ea55b6c8c9 100644
--- a/src/core/dbus-busname.h
+++ b/src/core/dbus-busname.h
@@ -21,7 +21,5 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "sd-bus.h"
-#include "unit.h"
extern const sd_bus_vtable bus_busname_vtable[];
diff --git a/src/core/dbus-device.c b/src/core/dbus-device.c
index f556536f33..cb156fd37c 100644
--- a/src/core/dbus-device.c
+++ b/src/core/dbus-device.c
@@ -21,7 +21,6 @@
#include "unit.h"
#include "device.h"
-#include "dbus-unit.h"
#include "dbus-device.h"
const sd_bus_vtable bus_device_vtable[] = {
diff --git a/src/core/dbus-device.h b/src/core/dbus-device.h
index 4aff226ab2..10e945e402 100644
--- a/src/core/dbus-device.h
+++ b/src/core/dbus-device.h
@@ -21,7 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "sd-bus.h"
#include "unit.h"
extern const sd_bus_vtable bus_device_vtable[];
diff --git a/src/core/dbus-manager.h b/src/core/dbus-manager.h
index e1903fa16a..3730deb576 100644
--- a/src/core/dbus-manager.h
+++ b/src/core/dbus-manager.h
@@ -21,7 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "sd-bus.h"
#include "manager.h"
extern const sd_bus_vtable bus_manager_vtable[];
diff --git a/src/core/dbus-mount.c b/src/core/dbus-mount.c
index 53fe4edc34..24813c6d20 100644
--- a/src/core/dbus-mount.c
+++ b/src/core/dbus-mount.c
@@ -21,7 +21,6 @@
#include "unit.h"
#include "mount.h"
-#include "dbus-unit.h"
#include "dbus-execute.h"
#include "dbus-kill.h"
#include "dbus-cgroup.h"
diff --git a/src/core/dbus-path.c b/src/core/dbus-path.c
index b5e894101d..683561999b 100644
--- a/src/core/dbus-path.c
+++ b/src/core/dbus-path.c
@@ -21,7 +21,6 @@
#include "unit.h"
#include "path.h"
-#include "dbus-unit.h"
#include "dbus-path.h"
#include "bus-util.h"
diff --git a/src/core/dbus-path.h b/src/core/dbus-path.h
index 667da05223..389b0d7f9b 100644
--- a/src/core/dbus-path.h
+++ b/src/core/dbus-path.h
@@ -22,6 +22,5 @@
***/
-#include "sd-bus.h"
extern const sd_bus_vtable bus_path_vtable[];
diff --git a/src/core/dbus-service.c b/src/core/dbus-service.c
index 6d4713babc..e1f3d56495 100644
--- a/src/core/dbus-service.c
+++ b/src/core/dbus-service.c
@@ -23,7 +23,6 @@
#include "path-util.h"
#include "unit.h"
#include "service.h"
-#include "dbus-unit.h"
#include "dbus-execute.h"
#include "dbus-kill.h"
#include "dbus-cgroup.h"
diff --git a/src/core/dbus-slice.c b/src/core/dbus-slice.c
index 8bc90b1dad..09e78d1f33 100644
--- a/src/core/dbus-slice.c
+++ b/src/core/dbus-slice.c
@@ -21,7 +21,6 @@
#include "unit.h"
#include "slice.h"
-#include "dbus-unit.h"
#include "dbus-cgroup.h"
#include "dbus-slice.h"
diff --git a/src/core/dbus-snapshot.c b/src/core/dbus-snapshot.c
index a1959defce..0be46c288e 100644
--- a/src/core/dbus-snapshot.c
+++ b/src/core/dbus-snapshot.c
@@ -23,7 +23,6 @@
#include "unit.h"
#include "dbus.h"
#include "snapshot.h"
-#include "dbus-unit.h"
#include "dbus-snapshot.h"
int bus_snapshot_method_remove(sd_bus *bus, sd_bus_message *message, void *userdata, sd_bus_error *error) {
diff --git a/src/core/dbus-socket.c b/src/core/dbus-socket.c
index 50b1674427..02599a9e55 100644
--- a/src/core/dbus-socket.c
+++ b/src/core/dbus-socket.c
@@ -21,9 +21,7 @@
#include "unit.h"
#include "socket.h"
-#include "dbus-unit.h"
#include "dbus-execute.h"
-#include "dbus-kill.h"
#include "dbus-cgroup.h"
#include "dbus-socket.h"
#include "bus-util.h"
diff --git a/src/core/dbus-swap.c b/src/core/dbus-swap.c
index 1e7f66d053..0093371306 100644
--- a/src/core/dbus-swap.c
+++ b/src/core/dbus-swap.c
@@ -22,9 +22,7 @@
#include "unit.h"
#include "swap.h"
-#include "dbus-unit.h"
#include "dbus-execute.h"
-#include "dbus-kill.h"
#include "dbus-cgroup.h"
#include "dbus-swap.h"
#include "bus-util.h"
diff --git a/src/core/dbus-target.c b/src/core/dbus-target.c
index 205d1c4a88..350f5c3ed2 100644
--- a/src/core/dbus-target.c
+++ b/src/core/dbus-target.c
@@ -20,8 +20,6 @@
***/
#include "unit.h"
-#include "target.h"
-#include "dbus-unit.h"
#include "dbus-target.h"
const sd_bus_vtable bus_target_vtable[] = {
diff --git a/src/core/dbus-target.h b/src/core/dbus-target.h
index 6be9c9f708..4c4297bc9e 100644
--- a/src/core/dbus-target.h
+++ b/src/core/dbus-target.h
@@ -21,6 +21,5 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "sd-bus.h"
extern const sd_bus_vtable bus_target_vtable[];
diff --git a/src/core/dbus-timer.c b/src/core/dbus-timer.c
index 43e785246c..74a9914358 100644
--- a/src/core/dbus-timer.c
+++ b/src/core/dbus-timer.c
@@ -21,10 +21,8 @@
#include "unit.h"
#include "timer.h"
-#include "dbus-unit.h"
#include "dbus-timer.h"
#include "bus-util.h"
-#include "errno-list.h"
#include "strv.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_result, timer_result, TimerResult);
diff --git a/src/core/dbus-unit.c b/src/core/dbus-unit.c
index fba3f7cc70..0ff9a01e11 100644
--- a/src/core/dbus-unit.c
+++ b/src/core/dbus-unit.c
@@ -24,11 +24,8 @@
#include "selinux-access.h"
#include "cgroup-util.h"
#include "strv.h"
-#include "path-util.h"
-#include "fileio.h"
#include "bus-common-errors.h"
#include "dbus.h"
-#include "dbus-manager.h"
#include "dbus-unit.h"
static BUS_DEFINE_PROPERTY_GET_ENUM(property_get_load_state, unit_load_state, UnitLoadState);
diff --git a/src/core/dbus.c b/src/core/dbus.c
index e7cf93dc6c..5dcb0d1c98 100644
--- a/src/core/dbus.c
+++ b/src/core/dbus.c
@@ -20,7 +20,6 @@
***/
#include <sys/epoll.h>
-#include <sys/timerfd.h>
#include <errno.h>
#include <unistd.h>
diff --git a/src/core/device.c b/src/core/device.c
index d3deac3936..2d983cc565 100644
--- a/src/core/device.c
+++ b/src/core/device.c
@@ -23,11 +23,9 @@
#include <sys/epoll.h>
#include <libudev.h>
-#include "strv.h"
#include "log.h"
#include "unit-name.h"
#include "dbus-device.h"
-#include "def.h"
#include "path-util.h"
#include "udev-util.h"
#include "unit.h"
diff --git a/src/core/device.h b/src/core/device.h
index bb7ae07834..906508530d 100644
--- a/src/core/device.h
+++ b/src/core/device.h
@@ -23,7 +23,6 @@
typedef struct Device Device;
-#include "unit.h"
/* We simply watch devices, we cannot plug/unplug them. That
* simplifies the state engine greatly */
diff --git a/src/core/execute.c b/src/core/execute.c
index 1815e3de2d..39ec5adbbe 100644
--- a/src/core/execute.c
+++ b/src/core/execute.c
@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
-#include <dirent.h>
#include <errno.h>
#include <fcntl.h>
#include <unistd.h>
@@ -29,14 +27,8 @@
#include <sys/socket.h>
#include <sys/un.h>
#include <sys/prctl.h>
-#include <linux/sched.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <grp.h>
-#include <pwd.h>
-#include <sys/mount.h>
-#include <linux/fs.h>
-#include <linux/oom.h>
#include <poll.h>
#include <glob.h>
#include <sys/personality.h>
@@ -80,12 +72,14 @@
#include "errno-list.h"
#include "af-list.h"
#include "mkdir.h"
-#include "apparmor-util.h"
#include "smack-util.h"
#include "bus-endpoint.h"
-#include "label.h"
#include "cap-list.h"
+#ifdef HAVE_APPARMOR
+#include "apparmor-util.h"
+#endif
+
#ifdef HAVE_SECCOMP
#include "seccomp-util.h"
#endif
diff --git a/src/core/execute.h b/src/core/execute.h
index 6e0c9faa75..1a43ac77b0 100644
--- a/src/core/execute.h
+++ b/src/core/execute.h
@@ -27,17 +27,12 @@ typedef struct ExecContext ExecContext;
typedef struct ExecRuntime ExecRuntime;
typedef struct ExecParameters ExecParameters;
-#include <linux/types.h>
-#include <sys/time.h>
-#include <sys/resource.h>
#include <sys/capability.h>
#include <stdbool.h>
#include <stdio.h>
#include <sched.h>
#include "list.h"
-#include "util.h"
-#include "set.h"
#include "fdset.h"
#include "missing.h"
#include "namespace.h"
diff --git a/src/core/failure-action.c b/src/core/failure-action.c
index ce522a4e4f..ffeb5cd31b 100644
--- a/src/core/failure-action.c
+++ b/src/core/failure-action.c
@@ -22,7 +22,6 @@
#include <sys/reboot.h>
#include <linux/reboot.h>
-#include <sys/syscall.h>
#include "bus-util.h"
#include "bus-error.h"
diff --git a/src/core/hostname-setup.c b/src/core/hostname-setup.c
index 6664e8952c..03b0ce3b4d 100644
--- a/src/core/hostname-setup.c
+++ b/src/core/hostname-setup.c
@@ -19,10 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <unistd.h>
#include <stdio.h>
#include <errno.h>
-#include <string.h>
#include <stdlib.h>
#include "hostname-setup.h"
diff --git a/src/core/ima-setup.c b/src/core/ima-setup.c
index 0e0d16a7c9..7721b3ecaf 100644
--- a/src/core/ima-setup.c
+++ b/src/core/ima-setup.c
@@ -22,10 +22,7 @@
***/
#include <unistd.h>
-#include <stdio.h>
#include <errno.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
#include "ima-setup.h"
diff --git a/src/core/job.c b/src/core/job.c
index 4740ff18cb..db7ebae6b1 100644
--- a/src/core/job.c
+++ b/src/core/job.c
@@ -19,10 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <errno.h>
-#include <sys/timerfd.h>
-#include <sys/epoll.h>
#include "sd-id128.h"
#include "sd-messages.h"
@@ -30,8 +27,6 @@
#include "unit.h"
#include "macro.h"
#include "strv.h"
-#include "load-fragment.h"
-#include "load-dropin.h"
#include "log.h"
#include "dbus-job.h"
#include "special.h"
diff --git a/src/core/job.h b/src/core/job.h
index d967b68a3f..9119e4834a 100644
--- a/src/core/job.h
+++ b/src/core/job.h
@@ -22,8 +22,6 @@
***/
#include <stdbool.h>
-#include <inttypes.h>
-#include <errno.h>
typedef struct Job Job;
typedef struct JobDependency JobDependency;
@@ -108,9 +106,7 @@ enum JobResult {
};
#include "sd-event.h"
-#include "manager.h"
#include "unit.h"
-#include "hashmap.h"
#include "list.h"
struct JobDependency {
diff --git a/src/core/kill.c b/src/core/kill.c
index 4271346511..60a510eae6 100644
--- a/src/core/kill.c
+++ b/src/core/kill.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <string.h>
#include "kill.h"
#include "util.h"
diff --git a/src/core/killall.c b/src/core/killall.c
index 5a50ae6f04..c6f1ddfec8 100644
--- a/src/core/killall.c
+++ b/src/core/killall.c
@@ -25,7 +25,6 @@
#include <unistd.h>
#include "util.h"
-#include "def.h"
#include "killall.h"
#include "set.h"
diff --git a/src/core/kmod-setup.c b/src/core/kmod-setup.c
index c0a05b97aa..efbdf31688 100644
--- a/src/core/kmod-setup.c
+++ b/src/core/kmod-setup.c
@@ -19,17 +19,14 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/wait.h>
#include <unistd.h>
#include <string.h>
-#include <errno.h>
#ifdef HAVE_KMOD
#include <libkmod.h>
#endif
#include "macro.h"
-#include "execute.h"
#include "capability.h"
#include "kmod-setup.h"
diff --git a/src/core/load-dropin.c b/src/core/load-dropin.c
index 8be190040e..11566af51b 100644
--- a/src/core/load-dropin.c
+++ b/src/core/load-dropin.c
@@ -19,8 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <dirent.h>
-#include <errno.h>
#include "unit.h"
#include "load-dropin.h"
@@ -29,7 +27,6 @@
#include "unit-name.h"
#include "conf-parser.h"
#include "load-fragment.h"
-#include "conf-files.h"
static int add_dependency_consumer(
UnitDependency dependency,
diff --git a/src/core/load-fragment.c b/src/core/load-fragment.c
index 90bf5634c8..6d0192fc72 100644
--- a/src/core/load-fragment.c
+++ b/src/core/load-fragment.c
@@ -21,26 +21,18 @@
***/
#include <linux/oom.h>
-#include <assert.h>
#include <errno.h>
#include <string.h>
-#include <unistd.h>
#include <fcntl.h>
#include <sched.h>
-#include <sys/prctl.h>
-#include <sys/mount.h>
#include <linux/fs.h>
#include <sys/stat.h>
-#include <sys/time.h>
#include <sys/resource.h>
-#include <sys/types.h>
-#include <grp.h>
#ifdef HAVE_SECCOMP
#include <seccomp.h>
#endif
-#include "sd-messages.h"
#include "unit.h"
#include "strv.h"
#include "conf-parser.h"
diff --git a/src/core/locale-setup.c b/src/core/locale-setup.c
index e993c57321..108072ca9f 100644
--- a/src/core/locale-setup.c
+++ b/src/core/locale-setup.c
@@ -19,13 +19,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <string.h>
#include <stdlib.h>
#include <errno.h>
#include "locale-setup.h"
#include "util.h"
-#include "macro.h"
#include "virt.h"
#include "fileio.h"
#include "strv.h"
diff --git a/src/core/loopback-setup.c b/src/core/loopback-setup.c
index 67ce160c19..63b15c1200 100644
--- a/src/core/loopback-setup.c
+++ b/src/core/loopback-setup.c
@@ -19,18 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/socket.h>
#include <net/if.h>
-#include <asm/types.h>
-#include <netinet/in.h>
-#include <string.h>
#include <stdlib.h>
-#include <unistd.h>
#include "sd-rtnl.h"
-#include "util.h"
-#include "macro.h"
-#include "socket-util.h"
#include "rtnl-util.h"
#include "missing.h"
#include "loopback-setup.h"
diff --git a/src/core/machine-id-setup.c b/src/core/machine-id-setup.c
index d00a53246f..063f705ede 100644
--- a/src/core/machine-id-setup.c
+++ b/src/core/machine-id-setup.c
@@ -23,7 +23,6 @@
#include <stdio.h>
#include <errno.h>
#include <string.h>
-#include <stdlib.h>
#include <fcntl.h>
#include <sys/mount.h>
diff --git a/src/core/main.c b/src/core/main.c
index 08f46f569a..d68e73769a 100644
--- a/src/core/main.c
+++ b/src/core/main.c
@@ -23,11 +23,9 @@
#include <errno.h>
#include <string.h>
#include <unistd.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <getopt.h>
#include <signal.h>
-#include <sys/wait.h>
#include <fcntl.h>
#include <sys/prctl.h>
#include <sys/mount.h>
@@ -40,14 +38,12 @@
#endif
#include "sd-daemon.h"
-#include "sd-messages.h"
#include "sd-bus.h"
#include "log.h"
#include "fdset.h"
#include "special.h"
#include "conf-parser.h"
#include "missing.h"
-#include "label.h"
#include "pager.h"
#include "build.h"
#include "strv.h"
@@ -55,7 +51,6 @@
#include "virt.h"
#include "architecture.h"
#include "watchdog.h"
-#include "path-util.h"
#include "switch-root.h"
#include "capability.h"
#include "killall.h"
diff --git a/src/core/manager.c b/src/core/manager.c
index 4775219e4a..79a9d54954 100644
--- a/src/core/manager.c
+++ b/src/core/manager.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <errno.h>
#include <string.h>
#include <signal.h>
@@ -27,14 +26,10 @@
#include <unistd.h>
#include <sys/inotify.h>
#include <sys/epoll.h>
-#include <poll.h>
#include <sys/reboot.h>
#include <sys/ioctl.h>
#include <linux/kd.h>
-#include <termios.h>
#include <fcntl.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <dirent.h>
#include <sys/timerfd.h>
@@ -43,7 +38,6 @@
#endif
#include "sd-daemon.h"
-#include "sd-id128.h"
#include "sd-messages.h"
#include "manager.h"
@@ -56,7 +50,6 @@
#include "mkdir.h"
#include "ratelimit.h"
#include "locale-setup.h"
-#include "mount-setup.h"
#include "unit-name.h"
#include "missing.h"
#include "path-lookup.h"
@@ -64,7 +57,6 @@
#include "exit-status.h"
#include "virt.h"
#include "watchdog.h"
-#include "cgroup-util.h"
#include "path-util.h"
#include "audit-fd.h"
#include "boot-timestamps.h"
diff --git a/src/core/manager.h b/src/core/manager.h
index d3971f1684..4e33ba63f4 100644
--- a/src/core/manager.h
+++ b/src/core/manager.h
@@ -22,7 +22,6 @@
***/
#include <stdbool.h>
-#include <inttypes.h>
#include <stdio.h>
#include "sd-bus.h"
@@ -31,7 +30,6 @@
#include "cgroup-util.h"
#include "hashmap.h"
#include "list.h"
-#include "set.h"
#include "ratelimit.h"
/* Enforce upper limit how many names we allow */
@@ -70,14 +68,11 @@ typedef enum StatusType {
STATUS_TYPE_EMERGENCY,
} StatusType;
-#include "unit.h"
#include "job.h"
#include "path-lookup.h"
#include "execute.h"
#include "unit-name.h"
-#include "exit-status.h"
#include "show-status.h"
-#include "failure-action.h"
struct Manager {
/* Note that the set of units we know of is allowed to be
diff --git a/src/core/mount-setup.c b/src/core/mount-setup.c
index 521545e5ce..343ff066a9 100644
--- a/src/core/mount-setup.c
+++ b/src/core/mount-setup.c
@@ -21,10 +21,7 @@
#include <sys/mount.h>
#include <errno.h>
-#include <sys/stat.h>
#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
#include <unistd.h>
#include <ftw.h>
@@ -42,7 +39,6 @@
#include "virt.h"
#include "efivars.h"
#include "smack-util.h"
-#include "def.h"
#include "cgroup-util.h"
typedef enum MountMode {
diff --git a/src/core/mount.c b/src/core/mount.c
index f3977e62de..40037e7866 100644
--- a/src/core/mount.c
+++ b/src/core/mount.c
@@ -21,7 +21,6 @@
#include <errno.h>
#include <stdio.h>
-#include <mntent.h>
#include <sys/epoll.h>
#include <signal.h>
#include <libmount.h>
@@ -30,8 +29,6 @@
#include "manager.h"
#include "unit.h"
#include "mount.h"
-#include "load-fragment.h"
-#include "load-dropin.h"
#include "log.h"
#include "sd-messages.h"
#include "strv.h"
@@ -41,9 +38,7 @@
#include "unit-name.h"
#include "dbus-mount.h"
#include "special.h"
-#include "bus-common-errors.h"
#include "exit-status.h"
-#include "def.h"
#include "fstab-util.h"
#define RETRY_UMOUNT_MAX 32
diff --git a/src/core/mount.h b/src/core/mount.h
index d6987e6fa1..76771ab7a9 100644
--- a/src/core/mount.h
+++ b/src/core/mount.h
@@ -23,10 +23,8 @@
typedef struct Mount Mount;
-#include "unit.h"
#include "kill.h"
#include "execute.h"
-#include "cgroup.h"
typedef enum MountState {
MOUNT_DEAD,
diff --git a/src/core/namespace.c b/src/core/namespace.c
index 4fecd32363..6a6d119314 100644
--- a/src/core/namespace.c
+++ b/src/core/namespace.c
@@ -25,23 +25,15 @@
#include <stdio.h>
#include <unistd.h>
#include <sys/stat.h>
-#include <sys/types.h>
#include <sched.h>
-#include <sys/syscall.h>
-#include <limits.h>
#include <linux/fs.h>
-#include <sys/file.h>
#include "strv.h"
#include "util.h"
#include "path-util.h"
#include "missing.h"
-#include "execute.h"
#include "loopback-setup.h"
-#include "mkdir.h"
#include "dev-setup.h"
-#include "def.h"
-#include "label.h"
#include "selinux-util.h"
#include "namespace.h"
diff --git a/src/core/path.c b/src/core/path.c
index e5ea79fec7..fbb695d87f 100644
--- a/src/core/path.c
+++ b/src/core/path.c
@@ -21,7 +21,6 @@
#include <sys/inotify.h>
#include <sys/epoll.h>
-#include <sys/ioctl.h>
#include <errno.h>
#include <unistd.h>
@@ -31,7 +30,6 @@
#include "mkdir.h"
#include "dbus-path.h"
#include "special.h"
-#include "path-util.h"
#include "macro.h"
#include "bus-util.h"
#include "bus-error.h"
diff --git a/src/core/path.h b/src/core/path.h
index 0d36aab960..dec39333e4 100644
--- a/src/core/path.h
+++ b/src/core/path.h
@@ -25,7 +25,6 @@ typedef struct Path Path;
typedef struct PathSpec PathSpec;
#include "unit.h"
-#include "mount.h"
typedef enum PathState {
PATH_DEAD,
diff --git a/src/core/scope.c b/src/core/scope.c
index b41db7872c..a0e4732533 100644
--- a/src/core/scope.c
+++ b/src/core/scope.c
@@ -20,12 +20,10 @@
***/
#include <errno.h>
-#include <signal.h>
#include <unistd.h>
#include "unit.h"
#include "scope.h"
-#include "load-fragment.h"
#include "log.h"
#include "dbus-scope.h"
#include "special.h"
diff --git a/src/core/scope.h b/src/core/scope.h
index 6c59126422..4452fe2c94 100644
--- a/src/core/scope.h
+++ b/src/core/scope.h
@@ -23,7 +23,6 @@
typedef struct Scope Scope;
-#include "unit.h"
#include "kill.h"
typedef enum ScopeState {
diff --git a/src/core/selinux-access.c b/src/core/selinux-access.c
index 18888747f2..a8c9a4b888 100644
--- a/src/core/selinux-access.c
+++ b/src/core/selinux-access.c
@@ -24,12 +24,9 @@
#ifdef HAVE_SELINUX
#include <stdio.h>
-#include <string.h>
#include <errno.h>
-#include <limits.h>
#include <selinux/selinux.h>
#include <selinux/avc.h>
-#include <sys/socket.h>
#ifdef HAVE_AUDIT
#include <libaudit.h>
#endif
@@ -38,7 +35,6 @@
#include "bus-util.h"
#include "util.h"
#include "log.h"
-#include "audit.h"
#include "selinux-util.h"
#include "audit-fd.h"
#include "strv.h"
diff --git a/src/core/selinux-access.h b/src/core/selinux-access.h
index dd1e8bb9d0..b5758e2e42 100644
--- a/src/core/selinux-access.h
+++ b/src/core/selinux-access.h
@@ -22,7 +22,6 @@
***/
#include "sd-bus.h"
-#include "bus-error.h"
#include "bus-util.h"
#include "manager.h"
diff --git a/src/core/selinux-setup.c b/src/core/selinux-setup.c
index fba915d7da..a4678500e6 100644
--- a/src/core/selinux-setup.c
+++ b/src/core/selinux-setup.c
@@ -22,8 +22,6 @@
#include <unistd.h>
#include <stdio.h>
#include <errno.h>
-#include <string.h>
-#include <stdlib.h>
#ifdef HAVE_SELINUX
#include <selinux/selinux.h>
@@ -31,8 +29,6 @@
#include "selinux-setup.h"
#include "selinux-util.h"
-#include "label.h"
-#include "mount-setup.h"
#include "macro.h"
#include "util.h"
#include "log.h"
diff --git a/src/core/service.c b/src/core/service.c
index 15e29be149..c7b35050bd 100644
--- a/src/core/service.c
+++ b/src/core/service.c
@@ -21,7 +21,6 @@
#include <errno.h>
#include <signal.h>
-#include <dirent.h>
#include <unistd.h>
#include "async.h"
diff --git a/src/core/service.h b/src/core/service.h
index dfeee6a68c..fe5afef46b 100644
--- a/src/core/service.h
+++ b/src/core/service.h
@@ -24,12 +24,10 @@
typedef struct Service Service;
typedef struct ServiceFDStore ServiceFDStore;
-#include "unit.h"
#include "path.h"
#include "ratelimit.h"
#include "kill.h"
#include "exit-status.h"
-#include "failure-action.h"
typedef enum ServiceState {
SERVICE_DEAD,
diff --git a/src/core/shutdown.c b/src/core/shutdown.c
index 71f001ac13..70a461e38c 100644
--- a/src/core/shutdown.c
+++ b/src/core/shutdown.c
@@ -20,21 +20,15 @@
***/
#include <sys/mman.h>
-#include <sys/types.h>
#include <sys/reboot.h>
#include <linux/reboot.h>
-#include <sys/wait.h>
#include <sys/stat.h>
#include <sys/mount.h>
-#include <sys/syscall.h>
-#include <fcntl.h>
-#include <dirent.h>
#include <errno.h>
#include <unistd.h>
#include <signal.h>
#include <stdbool.h>
#include <stdlib.h>
-#include <string.h>
#include <getopt.h>
#include "missing.h"
@@ -42,14 +36,12 @@
#include "fileio.h"
#include "umount.h"
#include "util.h"
-#include "mkdir.h"
#include "virt.h"
#include "watchdog.h"
#include "killall.h"
#include "cgroup-util.h"
#include "def.h"
#include "switch-root.h"
-#include "strv.h"
#define FINALIZE_ATTEMPTS 50
diff --git a/src/core/slice.c b/src/core/slice.c
index ae9819d015..4d2eaf7ed6 100644
--- a/src/core/slice.c
+++ b/src/core/slice.c
@@ -20,12 +20,9 @@
***/
#include <errno.h>
-#include <signal.h>
-#include <unistd.h>
#include "unit.h"
#include "slice.h"
-#include "load-fragment.h"
#include "log.h"
#include "dbus-slice.h"
#include "special.h"
diff --git a/src/core/slice.h b/src/core/slice.h
index ad0c63902b..ac648e56f8 100644
--- a/src/core/slice.h
+++ b/src/core/slice.h
@@ -23,7 +23,6 @@
typedef struct Slice Slice;
-#include "unit.h"
typedef enum SliceState {
SLICE_DEAD,
diff --git a/src/core/smack-setup.c b/src/core/smack-setup.c
index 59f6832bc2..ff2a02004d 100644
--- a/src/core/smack-setup.c
+++ b/src/core/smack-setup.c
@@ -24,21 +24,15 @@
#include <stdio.h>
#include <errno.h>
#include <string.h>
-#include <unistd.h>
#include <stdlib.h>
-#include <sys/vfs.h>
#include <fcntl.h>
-#include <sys/types.h>
#include <dirent.h>
-#include <sys/mount.h>
-#include <stdint.h>
#include "macro.h"
#include "smack-setup.h"
#include "util.h"
#include "fileio.h"
#include "log.h"
-#include "label.h"
#define SMACK_CONFIG "/etc/smack/accesses.d/"
#define CIPSO_CONFIG "/etc/smack/cipso.d/"
diff --git a/src/core/snapshot.h b/src/core/snapshot.h
index e6dc661060..f2451b1193 100644
--- a/src/core/snapshot.h
+++ b/src/core/snapshot.h
@@ -23,7 +23,6 @@
typedef struct Snapshot Snapshot;
-#include "unit.h"
typedef enum SnapshotState {
SNAPSHOT_DEAD,
diff --git a/src/core/socket.c b/src/core/socket.c
index 88aae4815b..7d052f2ef9 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <errno.h>
@@ -29,12 +28,9 @@
#include <arpa/inet.h>
#include <netinet/tcp.h>
#include <mqueue.h>
-#include <sys/xattr.h>
#include "sd-event.h"
#include "log.h"
-#include "load-dropin.h"
-#include "load-fragment.h"
#include "strv.h"
#include "mkdir.h"
#include "path-util.h"
diff --git a/src/core/socket.h b/src/core/socket.h
index a2e08998c0..5acf214e1c 100644
--- a/src/core/socket.h
+++ b/src/core/socket.h
@@ -23,8 +23,6 @@
typedef struct Socket Socket;
-#include "manager.h"
-#include "unit.h"
#include "socket-util.h"
#include "mount.h"
#include "service.h"
diff --git a/src/core/swap.c b/src/core/swap.c
index 6997921fde..f73a8e6deb 100644
--- a/src/core/swap.c
+++ b/src/core/swap.c
@@ -20,24 +20,17 @@
***/
#include <errno.h>
-#include <limits.h>
#include <unistd.h>
-#include <fcntl.h>
#include <sys/epoll.h>
#include <sys/stat.h>
-#include <sys/swap.h>
#include <libudev.h>
#include "unit.h"
#include "swap.h"
-#include "load-fragment.h"
-#include "load-dropin.h"
#include "unit-name.h"
#include "dbus-swap.h"
#include "special.h"
-#include "bus-common-errors.h"
#include "exit-status.h"
-#include "def.h"
#include "path-util.h"
#include "virt.h"
#include "udev-util.h"
diff --git a/src/core/swap.h b/src/core/swap.h
index 73e64d87a4..c36c6f2ce9 100644
--- a/src/core/swap.h
+++ b/src/core/swap.h
@@ -26,7 +26,6 @@
typedef struct Swap Swap;
-#include "unit.h"
typedef enum SwapState {
SWAP_DEAD,
diff --git a/src/core/target.c b/src/core/target.c
index 33fb66bc3f..8817ef21c4 100644
--- a/src/core/target.c
+++ b/src/core/target.c
@@ -19,13 +19,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <errno.h>
-#include <signal.h>
-#include <unistd.h>
#include "unit.h"
#include "target.h"
-#include "load-fragment.h"
#include "log.h"
#include "dbus-target.h"
#include "special.h"
diff --git a/src/core/target.h b/src/core/target.h
index a5398d9e98..0a25ef469a 100644
--- a/src/core/target.h
+++ b/src/core/target.h
@@ -23,7 +23,6 @@
typedef struct Target Target;
-#include "unit.h"
typedef enum TargetState {
TARGET_DEAD,
diff --git a/src/core/timer.c b/src/core/timer.c
index 45744c7de5..940550194b 100644
--- a/src/core/timer.c
+++ b/src/core/timer.c
@@ -28,7 +28,6 @@
#include "special.h"
#include "bus-util.h"
#include "bus-error.h"
-#include "mkdir.h"
static const UnitActiveState state_translation_table[_TIMER_STATE_MAX] = {
[TIMER_DEAD] = UNIT_INACTIVE,
diff --git a/src/core/timer.h b/src/core/timer.h
index de412a043e..9d919e4d3e 100644
--- a/src/core/timer.h
+++ b/src/core/timer.h
@@ -23,7 +23,6 @@
typedef struct Timer Timer;
-#include "unit.h"
#include "calendarspec.h"
typedef enum TimerState {
diff --git a/src/core/transaction.c b/src/core/transaction.c
index b0b3d6bd60..64c2af5a1c 100644
--- a/src/core/transaction.c
+++ b/src/core/transaction.c
@@ -23,7 +23,6 @@
#include <fcntl.h>
#include "bus-common-errors.h"
-#include "bus-util.h"
#include "bus-error.h"
#include "transaction.h"
diff --git a/src/core/umount.c b/src/core/umount.c
index dd7df194de..ceee70fbea 100644
--- a/src/core/umount.c
+++ b/src/core/umount.c
@@ -24,7 +24,6 @@
#include <string.h>
#include <sys/mount.h>
#include <sys/swap.h>
-#include <unistd.h>
#include <linux/loop.h>
#include <linux/dm-ioctl.h>
diff --git a/src/core/unit-printf.c b/src/core/unit-printf.c
index 97135db551..7736899a35 100644
--- a/src/core/unit-printf.c
+++ b/src/core/unit-printf.c
@@ -19,16 +19,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "sd-id128.h"
#include "unit.h"
#include "specifier.h"
-#include "path-util.h"
#include "strv.h"
#include "unit-name.h"
#include "unit-printf.h"
#include "macro.h"
#include "cgroup-util.h"
-#include "special.h"
static int specifier_prefix_and_instance(char specifier, void *data, void *userdata, char **ret) {
Unit *u = userdata;
diff --git a/src/core/unit.c b/src/core/unit.c
index ee8e607c27..ad5348b57b 100644
--- a/src/core/unit.c
+++ b/src/core/unit.c
@@ -19,12 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <errno.h>
#include <string.h>
-#include <sys/epoll.h>
-#include <sys/timerfd.h>
-#include <poll.h>
#include <stdlib.h>
#include <unistd.h>
#include <sys/stat.h>
@@ -45,12 +41,10 @@
#include "cgroup-util.h"
#include "missing.h"
#include "mkdir.h"
-#include "label.h"
#include "fileio-label.h"
#include "bus-common-errors.h"
#include "dbus.h"
#include "execute.h"
-#include "virt.h"
#include "dropin.h"
const UnitVTable * const unit_vtable[_UNIT_TYPE_MAX] = {
diff --git a/src/core/unit.h b/src/core/unit.h
index 291bc77a76..b3775d4d89 100644
--- a/src/core/unit.h
+++ b/src/core/unit.h
@@ -31,13 +31,7 @@ typedef enum UnitActiveState UnitActiveState;
typedef struct UnitRef UnitRef;
typedef struct UnitStatusMessageFormats UnitStatusMessageFormats;
-#include "sd-event.h"
-#include "set.h"
-#include "util.h"
#include "list.h"
-#include "socket-util.h"
-#include "execute.h"
-#include "cgroup.h"
#include "condition.h"
#include "install.h"
#include "unit-name.h"
@@ -76,7 +70,6 @@ static inline bool UNIT_IS_INACTIVE_OR_FAILED(UnitActiveState t) {
return t == UNIT_INACTIVE || t == UNIT_FAILED;
}
-#include "manager.h"
#include "job.h"
struct UnitRef {
@@ -249,13 +242,11 @@ typedef enum UnitSetPropertiesMode {
UNIT_PERSISTENT = 2,
} UnitSetPropertiesMode;
-#include "service.h"
#include "socket.h"
#include "busname.h"
#include "target.h"
#include "snapshot.h"
#include "device.h"
-#include "mount.h"
#include "automount.h"
#include "swap.h"
#include "timer.h"
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c
index 05061c0704..5a0611afbb 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 3f613d9b65..9e0fef7c6a 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 de963f7009..9f1f8f333b 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 9a924117db..606d073cbc 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 b3ff3a8b78..58c4cc278a 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 e7185342d7..cf4d375717 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 5662b5fde1..ccc7c6e26e 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 5c58b58f8a..07ee2cc793 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 1eec758935..8b9516cba8 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 7106719111..5530d2c421 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 f28eabbe37..43aac616b6 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 de4ce7ede6..5218b41b41 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 ede8185788..77b776fea6 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 4539673ead..446de3a2fc 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 8b632e88ae..ecec7a16a7 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 aa381c661e..7f47f8b014 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 8f32a9a988..ba811e0333 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 1cf22f6383..6c2ccb9735 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 79706b692d..2e236f0004 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 f170232841..e505a05305 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 6923753f89..4232206f44 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 136dda6d39..6294f16faa 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 f7ba0191e1..6357d3e277 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 afb39ad035..62983a73e4 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 5c8d6d6feb..a9f564c249 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 565fe8432c..118bb1367b 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 2845e05ce0..9b4967fb32 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 c527e65553..3ff6a3ad4a 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 832c327b31..a367dc1bb9 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 a7fb6f0f0d..c45cc31d0e 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 b03335ef31..35c270cb34 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 55c7786331..56435ff7b4 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 5363aaa4ff..f7ea779f0b 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 648ab22786..466239d3c6 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 7ee8174ea2..2488884634 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 c96877c508..559d100131 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 942a857803..bc5b26d118 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 80f4634f67..28a423326e 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 ab21cdc288..22f75540b8 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 a85c2b6063..37ea7b4a9c 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 c605ee0e70..dbfdea609d 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 980244e016..cde2025ae9 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 3c706018e9..3e6141771c 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 9da120c0bb..de9cd9c8b8 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 230d26596a..f7cc75b3d5 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 3fcd77475d..3258b22702 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 419a450436..f7a1492363 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 7f44d25499..643d4970d5 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 5f2d2cfbfd..7f10838de1 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 7581daeeeb..cd7f5095ca 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 a2bc7d5518..664d2f7867 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 b8e4e21716..d579755cc8 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 e51717e919..06aba893ce 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 5f90617b9e..4224e0197c 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 34aa36c6e6..fa1fa112b1 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 3f89f344d7..2634a730d6 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 19ef2ccdbd..0821730330 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 4f49b799ec..67a2cc6e97 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 8e88641430..d341210887 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 46c8c27061..6062a37dab 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 3e68f310f3..9f60ab761e 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 ee74ebd418..06545aee59 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 dff83eaf6e..40d04fdb21 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 f4c25b5556..d274225ed0 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 bc4d4c9e76..066a4d8b10 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 3b3cf2737b..feed579295 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 35d6eb2abf..db2a508fd8 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 dfbb2d197f..91ae507d91 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 6ee3d8150c..1ee13ffd15 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 989683f39a..44be7c30d2 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 c8c03f3d41..0e846179e6 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 6e13432d68..cccaabaa06 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 63cd2a5ad6..983a2a14ab 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 9ee32db1bc..cd61ea44e7 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 cad603d59f..aa5527ff32 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 a00a1912da..9db178861c 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 ae73cdf627..cbd8006734 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 df20a40451..833a099bd7 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 9e338776e8..d59139b62d 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 e22614d06d..e40b267b1c 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 cfeef61a47..2366d38574 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 2acfa9821a..0da81e8ff2 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 30527cb3fa..74ee5ecb3c 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 96c82d7e8f..a9350d7f51 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 e935833bc3..b17b62ac93 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 d29b98a269..3b3a5d357f 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 bd439a95dd..19aa4bd4f0 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 ea8a619c5a..a08391bfc2 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 3b337efa32..5430e535f0 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 7181639645..4bc896549a 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 02b95cd136..2d18a4e6c1 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 bebb2c2fac..1351938c80 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 d528ab2a04..e2f4550c7e 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 98312d123b..1914e6cb8b 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 df772036ee..4333445f2a 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 162f0ab608..a9e944c94b 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 076b85f3b9..77216a6f49 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 32955329b4..a68dee42b7 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 2e06e30548..c4fed0b53d 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 52883fa8cd..c15929c2bb 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 6be8310bbe..048178550b 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 b7914d15d3..6bc7b880a6 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 0e507839ca..581574ab73 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 e9efa3597c..9f048711de 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 d6b4cf05a7..ea807d5973 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 d3c1772019..d52dbdfd81 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 6a7f9c04ac..58a625fedd 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 8625ee6d89..7f49fe90fa 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 ff2602ba34..edd5033db2 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 67b6461f30..b2caa02870 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 35f87e91bd..1cacb95df3 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 071b7e0cf9..b11c43bd7b 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 c396eac2d2..8f4f60b65f 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 d95a03c221..7569ff98be 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 76ca0b6bf3..051969f9c7 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 acf67a52b3..895eda4eaa 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 5f807c3b1e..080d8eddb7 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 3fc565c620..4165c9273a 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 4ea9f9fc35..2d062fc9b5 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 028c2a7a5b..c9e2f2dba8 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 25089a0335..0c4e5179e3 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 61c7b446b3..3bbf02896b 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 02bd545526..11a0012348 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 c4713feb5d..297fdac80d 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 6448280c4f..ca517861d9 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 d08e1b5a05..3187ce9b8a 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 ef7def530d..bdc28d3510 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 276591f31b..8f7d50abbb 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 a4c71f3785..3f4ba2e0f0 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 5666ea44cb..9ddf074c24 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 ca9fbd4f41..9e4bdb867e 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 02f7a8e38a..47cce64816 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 fb4c6e2940..15d3b231c3 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 1a880c2a34..4e6e47cdeb 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 42fcb853c7..044ee3a0cb 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 3f1fee7f7e..eb7b6f87b2 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 8ef1f3d4b0..11e15d13e6 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 291829e6d8..0f8f634ca3 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 8785f22071..ec15d2576b 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 a94505c09e..eb58740d26 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 41a88a828c..515fca540a 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 5119fcd9b6..1fb8cdc341 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 44bda34aff..fcc8d72235 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 13b8102483..ec102ae4c7 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 5856f9079d..941fd724a5 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 0844df20a9..20c1c89eee 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 e9b424b5f6..ff98065371 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 d7211e66ce..610adc513e 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 72a612e914..80d93c7e6b 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 a6ff5add95..e8da59a182 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 5d61edbd46..3322d66aa9 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 76c5a5c88f..ee4c45fb8d 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 c273d2bfa0..6b2728586c 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 84fee0e773..5d81693e6c 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 f767876a4c..1b77fc1e9e 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 126c5b84cc..49808c928b 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 15f11b85ab..2a0f574be6 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 c2de862250..656f268dba 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 61a843d09d..1c9f998371 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 a02a537f7c..ce5dbb4d5c 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 3ec9d84f96..0505f7f0bd 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 f4c4490e8f..294c1e799c 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 2cb57e1675..be5b56883c 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 b44f376427..08a7cbc08a 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 e0cb7d0238..48e647ae82 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 274687d20f..03516de916 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 6edb823e8c..1c31769fde 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 c7e4de8889..d9c1b7c7a9 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 85bbfc4299..20cb60b804 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 ef1914e2b9..9061017eef 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 116e711a78..334abbdeb5 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 dc9115d39a..4eb24f9a1f 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 edd244f30d..182430d785 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 94dbac0160..7b27aa27e0 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 55cd854289..61183a6bf8 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 7a9ac2f349..0e5a494f8c 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 1373362e9d..f91f067135 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 df0cb82f8d..0f3df17d7f 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 5f678789ce..76e9403361 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 7ad11c6177..584a956a7e 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 47033acde4..255ff77022 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 feab8d421e..b6b8327b23 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 f716e8231a..0665e1fcfa 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 ce97ac0778..cffae835f5 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 88321ef84c..c9115516fd 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 91b7051a06..fd6af7e99b 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 01c10a2d73..bb246a2be0 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 9a7c280c6b..5189000c1f 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 198fb575ee..5f41f1c865 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 e95082d119..89ad3ee048 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 251cf92aec..9e9e1225e7 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 665559f895..0ed024b41d 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 d5128cb7c0..4a3a51104f 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 8119205dde..3d7cc73451 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 3756b1e5a7..7fd83964a5 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 36b40d32b9..b5f8f5cfb2 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 35ac064cf6..c6cf00a5e5 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 c2d1ffca25..7f110a5217 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 e091b20ed9..341bcae3fb 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 cafe110e50..1c997a50a4 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 66b865cfe2..73d129699d 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 7319276c53..723d10547c 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 6709ab0957..67fcca2ac0 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 f98075d513..a8ffbe9c8c 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 a9b9a3e062..08bfdcf4ed 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 a939bb267c..fed76c62e7 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 3f32ed0650..bc6c5dc2a0 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 2f0148f074..99a4f2f3c0 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 9ae3abd990..819706a72f 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 57b47021e4..70dacfafc1 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 abf5f525dd..d0d61b98ed 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 43ecf81ef6..068756cab1 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 e92280c319..8a9b3d459d 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 36f27ea031..516d244f7a 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 561dd3adfa..c5867386c6 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 f0483c9806..d619fae725 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 13b3ee4f81..788992e679 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 9d9a89d383..26796c842b 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 f05648e5a5..cfbde1343f 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 a438a27763..70ff35b08f 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 46eae31c60..fb81e9f1ac 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 182fb7714c..f6d539d315 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 4f0702e872..eee1846108 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 b5ad701611..167bea39b3 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 1151029d29..5a581cc13a 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 ce15a8011d..271247ca3f 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 ebc8d98fce..2f3edaf783 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 a4ff1ab878..34707e6b3d 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 390c3236e0..64e50401b9 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 c14843da49..c2bbd330bd 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 6e113eff7a..284043cd90 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 704ee6e1b4..0954e072be 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 4701c0a8de..4c1496f601 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 b4aecffb30..7e9c929ac6 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 f65363a67b..ec121d7403 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 d4ad2a419b..7816fae576 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 73907c6354..6bd317f354 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 54e0537a21..68419595fb 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 b34ac8b15a..2a70dfea45 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 61eb75bca2..9e9eaf4003 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 8033e8c7b2..bd5bffbfa5 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 915ceb9d9b..4840c3ebf4 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 6f2f6f997d..8260ae1a81 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 3146f56cad..aa832454b5 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 dfd8689b72..05c3125aec 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 39ab645133..ea781f5dea 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 96684681a4..e4e03df1e4 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 198a7b2753..8c2d235430 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 da7560f05f..f34b45f2a9 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 db4937db88..9ab08355e3 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 368c112eb3..3169a907f1 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 0b1af6c577..2148a30c66 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 e8b0810d23..cb15da8a5d 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 73e9edd29d..8751797f54 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 5b3c5f09c8..4f8a81dcdb 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 82364565ba..2492893718 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 038246d21b..00c2cdd8c4 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 618441a655..9de3621714 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 c63296f292..34d1331486 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 5c73b4d3c0..57022c5b8a 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 9e35ce5cec..31849272bd 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 c3c5e52286..340438d7c4 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 5fd69e0580..bec988ca78 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 7f16d5cbef..569b25bb7c 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 e63ba4bb5a..48d7502391 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 d853f17772..f62a0321e6 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 65f1c245c6..95ba718559 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 bb3d26f0e5..45c8ecedb3 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 a8457132e7..55976d513b 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 b323b2f7d4..2dedfa3fd1 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 c2495056d7..944d6856cd 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 8d9641e8ac..569e1faa55 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 8d61507e84..c734f148ae 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 6624c5e7db..e99a738e1f 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 cf588fe02f..3ed551fb37 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 ee11ac06ff..76bbc1edda 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 beefd1052a..b280618a97 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 e317df300e..2392d1fd1b 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 8635d9a600..f12bfb3287 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 291a2f4054..fbf46cd406 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 70bc1caa2a..12d1ec321f 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 fbe6295ea5..0f80f4863b 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 a87ceb58ca..63c7db2833 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 164c9b6ff3..9d4d61cef5 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 6208a543db..6f84e4036a 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 01b62b7b38..81fc9c19ff 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 309075e348..6814918464 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 1210aabdf6..a7c44d1b56 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 a2233e0cfb..82c6924e36 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 a694441000..8467185291 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 6806c51158..dfb8a1a431 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 a4e26b1d8c..74d90fa2a9 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 07d0aff72b..2d2b902369 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 ee267833e6..0d7458806d 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 8f259a8f39..bc1810da98 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 2347fd4328..fbc4e5f2a1 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 e27ac68151..ee45ad1d0f 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 7be246d570..ccc7e52f37 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 1ce6f721b7..2797d1a796 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 21b66913c9..0cc06f4f89 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 dc6528013b..241e7520b9 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 759d053c25..a9235536bf 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 bdb962af34..7fb6fe3a67 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 60a646878e..6e4511ecea 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 cc1ffa63f1..eee6bc8982 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 a3c3c87f11..715f440cb1 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 ad34ef1366..00045150f6 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 9b083131df..4e90f68622 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 e47bcb4dca..0b5668a338 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 bd67f321f6..25b10c1a49 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 cb75f7314d..2d109a30e7 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 150a32ad6f..c49b832179 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 632d62ff8f..43a2d35b80 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 43769923b0..f47452ce72 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 9e9de23e0e..d14a07e1f4 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 67eeeb56b7..9834a6a130 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 46642f92fe..4be69a408d 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 f97c78ebd6..6a2f9aa943 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 456999ca40..c8d0a147a7 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 0274e97618..8f1fcd992c 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 91ccaf72b8..428fd32600 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 6900da9e89..40be084ffb 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 86efa1a3f7..c7e5de896b 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 467970b007..5ee52e64cb 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 1d9d49b228..af0d76e894 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 b09131891c..24dc7003bc 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 293c151d42..2b004fdfb1 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 1398a3a0b9..9765075365 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 75fe053b63..c03bda4382 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 7cd7b77153..76b131c284 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 38e5c93df6..a951b01b97 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 cab569a9da..eadecb99a0 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 a9dd01ca01..cb8a5d4e9e 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 c8133dbad7..c406454f77 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 e280c8952d..ac292ed680 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 a1020ad14c..1d75d05a88 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 a7c8e1267d..858a4081da 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 bda224bec6..0e5ab1645f 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 4b72c4a8fa..90e49d4542 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 b57d275efa..4403624c5a 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 e517f571d6..22ac76de56 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 5c7f8b40f7..7d882aebd6 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 f6bb045c3c..2e5d0c3aae 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 4d89886736..9e04f8f7bf 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 23efe832a7..18dcd18b00 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 be1f4bb151..df4d89a620 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 73ac7eecbf..a9e91c4d60 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 c7efdc5dfb..b1a844ba76 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 2a73dac033..735668bede 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 88ba7e46a2..2642934147 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 0f1b3c6ec3..9e2c590c15 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 4bb6edbef1..6cf41c67bb 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 8b3dc45d4e..810a88153c 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 cb434d1aee..34facdeb5d 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 03e3dc2867..f4f6900d14 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 3643596a70..3352821567 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 95476648f9..5e0e7ebb11 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 d8ee4cbb61..8ab1be89ee 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 ad2829e500..81e78a8aa3 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 b78c09b910..99bb91ae57 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 1950ec23a1..d2aec1b200 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 59a3eceaad..c0c5981db8 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 bc115f112d..1c5d5e9a49 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 793b48469d..debf9ea88b 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 6ba8674d77..15b76dd6ab 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 6af7163d47..78170463b6 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 d65e40c011..00609e31b5 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 0bab01a234..352e024a7c 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 15ded09339..7ef2e68233 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 fff5de7a8b..0d3025ed16 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 baaeca9352..35a7349439 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 4922b5b6ac..542c56eb1a 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 4dc756a28b..11e83f355f 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 56cd0cd4ec..b86d8921f3 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 99d4c8983a..0556356f65 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 561963e5eb..44caf84faf 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 5e7498c9e2..33535ebd7f 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 28371711b6..bf681d9f3a 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"