tree-wide: Clean up includes

This removes more unused includes from the components already cleaned
up in #37467 and #37457.

Split out of #37344.
This commit is contained in:
Daan De Meyer
2025-05-21 10:49:42 +02:00
parent 8b5ce49591
commit 86b9a3e31d
58 changed files with 9 additions and 81 deletions
-1
View File
@@ -2,7 +2,6 @@
#include <getopt.h>
#include <sys/socket.h>
#include <unistd.h>
#include "sd-messages.h"
-1
View File
@@ -2,7 +2,6 @@
#include <getopt.h>
#include <stdio.h>
#include <unistd.h>
#include "sd-bus.h"
-1
View File
@@ -20,7 +20,6 @@
#include "process-util.h"
#include "procfs-util.h"
#include "sort-util.h"
#include "strv.h"
#include "terminal-util.h"
#include "time-util.h"
#include "virt.h"
-1
View File
@@ -2,7 +2,6 @@
#include <sys/stat.h>
#include <sys/statvfs.h>
#include <unistd.h>
#include "alloc-util.h"
#include "coredump-vacuum.h"
+1 -1
View File
@@ -1,7 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <elf.h>
#include <stdio.h>
#include <sys/auxv.h>
#include <sys/mount.h>
#include <sys/prctl.h>
#include <sys/statvfs.h>
-1
View File
@@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <getopt.h>
#include <sys/prctl.h>
#include <unistd.h>
#include "alloc-util.h"
-2
View File
@@ -6,8 +6,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/mount.h>
#include "sd-device.h"
-2
View File
@@ -2,7 +2,6 @@
#include <fcntl.h>
#include <getopt.h>
#include <linux/loop.h>
#include <unistd.h>
#include "sd-bus.h"
@@ -51,7 +50,6 @@
#include "terminal-util.h"
#include "time-util.h"
#include "tmpfile-util-label.h"
#include "umask-util.h"
#include "user-util.h"
#include "vconsole-util.h"
-1
View File
@@ -5,7 +5,6 @@
#include <fcntl.h>
#include <sys/file.h>
#include <sys/prctl.h>
#include <sys/stat.h>
#include <unistd.h>
@@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <sys/file.h>
#include <unistd.h>
#include "sd-id128.h"
-3
View File
@@ -2,9 +2,6 @@
#include <fcntl.h>
#include <getopt.h>
#include <linux/magic.h>
#include <sys/ioctl.h>
#include <sys/mount.h>
#include <sys/vfs.h>
#include "alloc-util.h"
-2
View File
@@ -2,9 +2,7 @@
#include <fcntl.h>
#include <sys/file.h>
#include <sys/prctl.h>
#include <sys/stat.h>
#include <unistd.h>
#include "alloc-util.h"
#include "blockdev-util.h"
+1
View File
@@ -14,6 +14,7 @@
#include "bus-common-errors.h"
#include "bus-get-properties.h"
#include "bus-log-control-api.h"
#include "bus-object.h"
#include "bus-polkit.h"
#include "bus-util.h"
#include "constants.h"
@@ -1,8 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
#include "alloc-util.h"
#include "fd-util.h"
-1
View File
@@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <getopt.h>
#include <unistd.h>
#include "alloc-util.h"
#include "ask-password-api.h"
+1 -2
View File
@@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <sys/stat.h>
#include <unistd.h>
#include "sd-bus.h"
#include "sd-event.h"
@@ -10,6 +9,7 @@
#include "bus-error.h"
#include "bus-locator.h"
#include "bus-log-control-api.h"
#include "bus-object.h"
#include "bus-polkit.h"
#include "bus-unit-util.h"
#include "bus-util.h"
@@ -23,7 +23,6 @@
#include "service-util.h"
#include "string-util.h"
#include "strv.h"
#include "time-util.h"
static int vconsole_reload(sd_bus *bus) {
_cleanup_(sd_bus_error_free) sd_bus_error error = SD_BUS_ERROR_NULL;
-1
View File
@@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <stdlib.h>
#include <sys/wait.h>
#include "sd-daemon.h"
-1
View File
@@ -25,7 +25,6 @@
#include "loop-util.h"
#include "main-func.h"
#include "memory-util.h"
#include "missing_syscall.h"
#include "namespace-util.h"
#include "nsresource.h"
#include "nulstr-util.h"
-2
View File
@@ -1,8 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <stdlib.h>
#include <sys/mount.h>
#include <sys/wait.h>
#include "sd-daemon.h"
+1 -2
View File
@@ -7,9 +7,8 @@
#include <net/if.h>
#include <poll.h>
#include <sys/eventfd.h>
#include <sys/mount.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <utmpx.h>
#include "sd-daemon.h"
-3
View File
@@ -1,13 +1,10 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <sys/stat.h>
#include <sched.h>
#include <sys/mount.h>
#include "bpf-dlopen.h"
#include "bpf-link.h"
#include "fd-util.h"
#include "fs-util.h"
#include "log.h"
#include "lsm-util.h"
#include "mkdir.h"
-1
View File
@@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
#include "sd-bus.h"
-1
View File
@@ -3,7 +3,6 @@
#include "sd-bus-vtable.h"
#include "bus-object.h"
#include "portabled-forward.h"
int bus_image_common_get_os_release(Manager *m, sd_bus_message *message, const char *name_or_path, Image *image, sd_bus_error *error);
+1 -2
View File
@@ -7,6 +7,7 @@
#include "alloc-util.h"
#include "bus-log-control-api.h"
#include "bus-object.h"
#include "bus-util.h"
#include "common-signal.h"
#include "constants.h"
@@ -15,10 +16,8 @@
#include "log.h"
#include "main-func.h"
#include "portabled.h"
#include "portabled-image-bus.h"
#include "service-util.h"
#include "signal-util.h"
#include "time-util.h"
static Manager* manager_unref(Manager *m);
DEFINE_TRIVIAL_CLEANUP_FUNC(Manager*, manager_unref);
-1
View File
@@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#pragma once
#include "bus-object.h"
#include "list.h"
#include "portabled-forward.h"
#include "runtime-scope.h"
-3
View File
@@ -5,9 +5,6 @@
/* Generally speaking, the pstore contains a small number of files
* that in turn contain a small amount of data. */
#include <stdio.h>
#include <stdio_ext.h>
#include <sys/prctl.h>
#include <sys/xattr.h>
#include <unistd.h>
#include "sd-journal.h"
-1
View File
@@ -1,6 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <sys/prctl.h>
#include <sys/stat.h>
#include <unistd.h>
-2
View File
@@ -2,9 +2,7 @@
#include <fcntl.h>
#include <getopt.h>
#include <linux/random.h>
#include <stdlib.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sys/xattr.h>
#include <unistd.h>
-1
View File
@@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <mntent.h>
#include <sys/prctl.h>
#include <sys/stat.h>
#include <sys/wait.h>
#include <unistd.h>
-5
View File
@@ -1,12 +1,7 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#if HAVE_VALGRIND_MEMCHECK_H
#include <valgrind/memcheck.h>
#endif
#include <fcntl.h>
#include <getopt.h>
#include <linux/loop.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
-2
View File
@@ -1,7 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <sys/un.h>
#include "fd-util.h"
#include "fileio.h"
#include "log.h"
-1
View File
@@ -5,7 +5,6 @@
#include <stdio.h>
#include <stdlib.h>
#include <sys/resource.h>
#include <sys/stat.h>
#include "sd-bus.h"
#include "sd-daemon.h"
-1
View File
@@ -5,7 +5,6 @@
#include <linux/loop.h>
#include <sys/ioctl.h>
#include <unistd.h>
#if HAVE_VALGRIND_MEMCHECK_H
#include <valgrind/memcheck.h>
-1
View File
@@ -6,7 +6,6 @@
#include <linux/major.h>
#include <linux/raid/md_u.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include "sd-device.h"
+1 -2
View File
@@ -5,11 +5,11 @@
#include <fcntl.h>
#include <sys/mount.h>
#include <sys/stat.h>
#include <unistd.h>
#include "alloc-util.h"
#include "chase.h"
#include "constants.h"
#include "dirent-util.h"
#include "errno-util.h"
#include "fd-util.h"
@@ -29,7 +29,6 @@
#include "signal-util.h"
#include "stat-util.h"
#include "string-util.h"
#include "time-util.h"
#include "umount.h"
#include "virt.h"
+1
View File
@@ -13,6 +13,7 @@
#include "parse-util.h"
#include "siphash24.h"
#include "string-util.h"
#include "time-util.h"
#define DISCHARGE_RATE_FILEPATH "/var/lib/systemd/sleep/battery_discharge_percentage_rate_per_hour"
#define BATTERY_DISCHARGE_RATE_HASH_KEY SD_ID128_MAKE(5f,9a,20,18,38,76,46,07,8d,36,58,0b,bb,c4,e0,63)
-1
View File
@@ -2,7 +2,6 @@
#pragma once
#include "hashmap.h"
#include "time-util.h"
int fetch_batteries_capacity_by_name(Hashmap **ret_current_capacity);
int get_capacity_by_name(Hashmap *capacities_by_name, const char *name);
-1
View File
@@ -10,7 +10,6 @@
#include <stdlib.h>
#include <sys/timerfd.h>
#include <sys/utsname.h>
#include <unistd.h>
#include "sd-bus.h"
#include "sd-device.h"
+1
View File
@@ -7,6 +7,7 @@
#include "hashmap.h"
#include "log.h"
#include "tests.h"
#include "time-util.h"
TEST(fetch_batteries_capacity_by_name) {
_cleanup_hashmap_free_ Hashmap *capacity = NULL;
-1
View File
@@ -2,7 +2,6 @@
#include <getopt.h>
#include <sys/epoll.h>
#include <sys/prctl.h>
#include <sys/wait.h>
#include <unistd.h>
-1
View File
@@ -4,7 +4,6 @@
#include <getopt.h>
#include <netdb.h>
#include <stdio.h>
#include <sys/un.h>
#include <unistd.h>
#include "sd-daemon.h"
-2
View File
@@ -1,7 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <fcntl.h>
#include <sys/ioctl.h>
#include <unistd.h>
#include "alloc-util.h"
-1
View File
@@ -1,6 +1,5 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <net/if_arp.h>
#include <unistd.h>
#include "sd-varlink.h"
-2
View File
@@ -3,8 +3,6 @@
Copyright © 2017 Felipe Sateler
***/
#include <sys/prctl.h>
#include "sd-bus.h"
#include "alloc-util.h"
-1
View File
@@ -35,7 +35,6 @@
#include "log.h"
#include "loop-util.h"
#include "main-func.h"
#include "missing_magic.h"
#include "mkdir.h"
#include "mount-util.h"
#include "mountpoint-util.h"
+1
View File
@@ -17,6 +17,7 @@
#include "bus-log-control-api.h"
#include "bus-map-properties.h"
#include "bus-message-util.h"
#include "bus-object.h"
#include "bus-polkit.h"
#include "bus-unit-util.h"
#include "bus-util.h"
-1
View File
@@ -2,7 +2,6 @@
#include <getopt.h>
#include <sys/stat.h>
#include <unistd.h>
#include "sd-messages.h"
@@ -10,7 +10,6 @@
#include <sys/prctl.h>
#include <sys/signalfd.h>
#include <sys/stat.h>
#include <sys/un.h>
#include <sys/wait.h>
#include <unistd.h>
-1
View File
@@ -2,7 +2,6 @@
#include <getopt.h>
#include <sys/stat.h>
#include <unistd.h>
#include "alloc-util.h"
#include "chase.h"
-1
View File
@@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <sys/stat.h>
#include <unistd.h>
#if HAVE_AUDIT
# include <libaudit.h>
-2
View File
@@ -1,8 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <fcntl.h>
#include <sys/stat.h>
#include <unistd.h>
#include "fs-util.h"
#include "label-util.h"
-1
View File
@@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <stdlib.h>
#include <sys/wait.h>
#include "sd-daemon.h"
-1
View File
@@ -1,7 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <poll.h>
#include <sys/wait.h>
#include "sd-daemon.h"
#include "sd-varlink.h"
-1
View File
@@ -7,7 +7,6 @@
#include <linux/kd.h>
#include <linux/tiocl.h>
#include <linux/vt.h>
#include <sys/file.h>
#include <sys/ioctl.h>
#include <sys/stat.h>
#include <sysexits.h>
-2
View File
@@ -1,8 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
#include "sd-id128.h"
-2
View File
@@ -1,8 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <getopt.h>
#include <linux/if.h>
#include <net/if.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -2,7 +2,6 @@
#include <stdlib.h>
#include <sys/stat.h>
#include <unistd.h>
#include "alloc-util.h"
#include "dirent-util.h"
@@ -1,8 +1,6 @@
/* SPDX-License-Identifier: LGPL-2.1-or-later */
#include <fnmatch.h>
#include <stdio.h>
#include <unistd.h>
#include "alloc-util.h"
#include "conf-parser.h"