]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
udev: Clean up includes
authorDaan De Meyer <daan.j.demeyer@gmail.com>
Wed, 21 May 2025 12:07:30 +0000 (14:07 +0200)
committerYu Watanabe <watanabe.yu+github@gmail.com>
Wed, 21 May 2025 14:57:31 +0000 (23:57 +0900)
Split out of #37344.

84 files changed:
src/udev/ata_id/ata_id.c
src/udev/cdrom_id/cdrom_id.c
src/udev/dmi_memory_id/dmi_memory_id.c
src/udev/fido_id/fido_id.c
src/udev/fido_id/fido_id_desc.c
src/udev/fido_id/fido_id_desc.h
src/udev/fido_id/fuzz-fido-id-desc.c
src/udev/fido_id/test-fido-id-desc.c
src/udev/fuzz-udev-rules.c
src/udev/iocost/iocost.c
src/udev/mtd_probe/mtd_probe.c
src/udev/mtd_probe/mtd_probe.h
src/udev/mtd_probe/probe_smartmedia.c
src/udev/net/fuzz-link-parser.c
src/udev/net/link-config-gperf.gperf
src/udev/net/link-config.c
src/udev/net/link-config.h
src/udev/scsi_id/scsi.h
src/udev/scsi_id/scsi_id.c
src/udev/scsi_id/scsi_serial.c
src/udev/test-udev-builtin.c
src/udev/test-udev-rule-runner.c
src/udev/test-udev-spawn.c
src/udev/udev-builtin-blkid.c
src/udev/udev-builtin-btrfs.c
src/udev/udev-builtin-dissect_image.c
src/udev/udev-builtin-factory_reset.c
src/udev/udev-builtin-hwdb.c
src/udev/udev-builtin-input_id.c
src/udev/udev-builtin-keyboard.c
src/udev/udev-builtin-kmod.c
src/udev/udev-builtin-net_driver.c
src/udev/udev-builtin-net_id.c
src/udev/udev-builtin-net_setup_link.c
src/udev/udev-builtin-path_id.c
src/udev/udev-builtin-usb_id.c
src/udev/udev-builtin.h
src/udev/udev-config.c
src/udev/udev-config.h
src/udev/udev-ctrl.c
src/udev/udev-ctrl.h
src/udev/udev-def.h
src/udev/udev-dump.c
src/udev/udev-dump.h
src/udev/udev-error.c
src/udev/udev-error.h
src/udev/udev-event.c
src/udev/udev-event.h
src/udev/udev-format.c
src/udev/udev-format.h
src/udev/udev-forward.h [new file with mode: 0644]
src/udev/udev-manager-ctrl.h
src/udev/udev-manager.c
src/udev/udev-manager.h
src/udev/udev-node.c
src/udev/udev-node.h
src/udev/udev-rules.c
src/udev/udev-rules.h
src/udev/udev-spawn.c
src/udev/udev-spawn.h
src/udev/udev-trace.h
src/udev/udev-varlink.c
src/udev/udev-varlink.h
src/udev/udev-watch.c
src/udev/udev-watch.h
src/udev/udev-worker.c
src/udev/udev-worker.h
src/udev/udevadm-control.c
src/udev/udevadm-hwdb.c
src/udev/udevadm-info.c
src/udev/udevadm-lock.c
src/udev/udevadm-monitor.c
src/udev/udevadm-settle.c
src/udev/udevadm-test-builtin.c
src/udev/udevadm-test.c
src/udev/udevadm-trigger.c
src/udev/udevadm-util.c
src/udev/udevadm-util.h
src/udev/udevadm-verify.c
src/udev/udevadm-wait.c
src/udev/udevadm.c
src/udev/udevadm.h
src/udev/udevd.c
src/udev/v4l_id/v4l_id.c

index 84cd93c040a941c33c90e65c6d31823c19ac4823..eea04f70aabdba6489b66fde679ff6d66b0bf60d 100644 (file)
@@ -5,30 +5,20 @@
  * Copyright © 2009-2010 David Zeuthen <zeuthen@gmail.com>
  */
 
-#include <ctype.h>
-#include <errno.h>
 #include <fcntl.h>
 #include <getopt.h>
 #include <linux/bsg.h>
 #include <linux/hdreg.h>
-#include <scsi/scsi.h>
-#include <scsi/scsi_ioctl.h>
 #include <scsi/sg.h>
-#include <stdint.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
 #include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
 
 #include "build.h"
 #include "device-nodes.h"
 #include "fd-util.h"
 #include "log.h"
 #include "main-func.h"
-#include "memory-util.h"
 #include "udev-util.h"
 #include "unaligned.h"
 
index 748093a275aa2db53049bb8ac6d5aa8d5658bb06..a36f72e594aeceaa0fd74de0c7a7c3d7aa29fa55 100644 (file)
@@ -8,17 +8,16 @@
 #include <linux/cdrom.h>
 #include <scsi/sg.h>
 #include <sys/ioctl.h>
-#include <unistd.h>
 
 #include "alloc-util.h"
 #include "build.h"
 #include "fd-util.h"
 #include "main-func.h"
-#include "memory-util.h"
 #include "random-util.h"
 #include "sort-util.h"
 #include "string-table.h"
 #include "string-util.h"
+#include "time-util.h"
 #include "udev-util.h"
 #include "unaligned.h"
 
index e62222a3070916415e36bcb5f8b309d54578d090..9475edcd5418cf894200486ae94e977dea62ad61 100644 (file)
@@ -43,6 +43,7 @@
  */
 
 #include <getopt.h>
+#include <stdio.h>
 
 #include "alloc-util.h"
 #include "build.h"
index 2bd64ee75edaf41708bab4e933494efc3e19c0ac..aa918a9798460fe0c1b6d1acb5eff1facf8e9ebf 100644 (file)
@@ -6,13 +6,10 @@
  * Inspired by Andrew Lutomirski's 'u2f-hidraw-policy.c'
  */
 
-#include <errno.h>
 #include <fcntl.h>
 #include <getopt.h>
 #include <linux/hid.h>
 #include <stdio.h>
-#include <stdlib.h>
-#include <sys/types.h>
 #include <unistd.h>
 
 #include "alloc-util.h"
 #include "fd-util.h"
 #include "fido_id_desc.h"
 #include "log.h"
-#include "macro.h"
 #include "main-func.h"
 #include "path-util.h"
-#include "string-util.h"
 #include "udev-util.h"
 
 static const char *arg_device = NULL;
index 2dfa759032b768b6f90bf11a108e2d80b43d58a0..87cfb64587c8eac5b7771ab7d98b7f84fbb70c3e 100644 (file)
@@ -1,11 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 /* Inspired by Andrew Lutomirski's 'u2f-hidraw-policy.c' */
 
-#include <errno.h>
-#include <stdbool.h>
-#include <stddef.h>
-#include <stdint.h>
-
 #include "fido_id_desc.h"
 
 #define HID_RPTDESC_FIRST_BYTE_LONG_ITEM 0xfeu
index 57af57e889249ccaf80998fe6d59f321bcc797c3..90ae6cbdf1e232668cf8af68535c5ca27bd2e3d8 100644 (file)
@@ -2,7 +2,6 @@
 
 #pragma once
 
-#include <stddef.h>
-#include <stdint.h>
+#include "forward.h"
 
 int is_fido_security_token_desc(const uint8_t *desc, size_t desc_len);
index 040d77a48775546cafe71f847cecb2cf9ac4d49a..1475d1ff39b99273b920e62651eb39236002d315 100644 (file)
@@ -1,13 +1,9 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <linux/hid.h>
-#include <stdbool.h>
-#include <stdint.h>
-#include <stdlib.h>
 
 #include "fido_id_desc.h"
 #include "fuzz.h"
-#include "log.h"
 
 int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
         fuzz_setup_logging();
index 0564e64ab96a4d1256a26a873af56c78c869e610..eb64babacbaa22e2b9da0a946c84b0b88bf19844 100644 (file)
@@ -1,11 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <stdint.h>
-#include <stdlib.h>
-
 #include "fido_id_desc.h"
-#include "log.h"
-#include "macro.h"
 #include "tests.h"
 
 TEST(is_fido_security_token_desc__fido) {
index 0a1056d4b529c782263f235cf2d822d67a57fba5..da94cdaf7e133afe27dbdd3702c2d3542f3fe4cb 100644 (file)
@@ -3,9 +3,7 @@
 #include <stdio.h>
 
 #include "fd-util.h"
-#include "fs-util.h"
 #include "fuzz.h"
-#include "tests.h"
 #include "tmpfile-util.h"
 #include "udev-rules.h"
 
index 58242a33e745771891259f87f5bd707598cc7572..7558160d7b5a584ecf3fa9894cccc1771f81c1ee 100644 (file)
@@ -1,9 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
 #include <getopt.h>
 #include <stdio.h>
-#include <unistd.h>
 
 #include "sd-device.h"
 
@@ -14,8 +12,6 @@
 #include "device-util.h"
 #include "devnum-util.h"
 #include "main-func.h"
-#include "path-util.h"
-#include "pretty-print.h"
 #include "string-util.h"
 #include "strv.h"
 #include "udev-util.h"
index 69dd50a24ad2c46ef46170e4ff637be0b41790f3..1bee120912a02b0d92ec48fffe9d36af83241150 100644 (file)
  * Boston, MA  02110-1301  USA
  */
 
-#include <errno.h>
 #include <fcntl.h>
 #include <getopt.h>
 #include <mtd/mtd-user.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <sys/ioctl.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
 
-#include "alloc-util.h"
 #include "build.h"
 #include "fd-util.h"
 #include "log.h"
index ae03a7d2f7ec33325472276a9df354e3317fa508..fe1f28d12fd88b0920dd2b1ad3d27aaa28c0e477 100644 (file)
@@ -22,7 +22,7 @@
 
 #include <mtd/mtd-user.h>
 
-#include "macro.h"
+#include "forward.h"
 
 /* Full oob structure as written on the flash */
 struct sm_oob {
index 67f7009c6381bcc7f10d1fa5a23c16b9226c3994..9ce49b85529c11518a6f6352c911d66ac1e95829 100644 (file)
  * Boston, MA  02110-1301  USA
  */
 
-#include <errno.h>
-#include <fcntl.h>
 #include <mtd/mtd-user.h>
-#include <stdint.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
-#include <sys/stat.h>
-#include <sys/types.h>
 #include <unistd.h>
 
 #include "alloc-util.h"
index 2833162cc12216e177c148890c365ba1c3f5e0c2..2876580acaeac03fd801946d5b8d60a9eabe2eec 100644 (file)
@@ -1,7 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include "fd-util.h"
-#include "fs-util.h"
 #include "fuzz.h"
 #include "link-config.h"
 #include "tmpfile-util.h"
index d7cb07ba00f76ff75cf140fdb18846b560cc0b1b..ef3ebf41cd545c976f7e17ceea70e0c4b2b7c78f 100644 (file)
@@ -5,6 +5,7 @@ _Pragma("GCC diagnostic ignored \"-Wimplicit-fallthrough\"")
 _Pragma("GCC diagnostic ignored \"-Wzero-as-null-pointer-constant\"")
 #endif
 #include <stddef.h>
+#include "condition.h"
 #include "conf-parser.h"
 #include "ethtool-util.h"
 #include "link-config.h"
index 85a2d8490ab8d70e4a98641631769f945c132760..7437c9561f3b1838de46874f6de3a4aa6787d0d6 100644 (file)
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <linux/netdevice.h>
-#include <netinet/ether.h>
+#include <net/if_arp.h>
 #include <unistd.h>
 
 #include "sd-device.h"
@@ -9,29 +9,34 @@
 
 #include "alloc-util.h"
 #include "arphrd-util.h"
+#include "condition.h"
 #include "conf-files.h"
 #include "conf-parser.h"
-#include "constants.h"
+#include "cpu-set-util.h"
 #include "creds-util.h"
 #include "device-private.h"
 #include "device-util.h"
 #include "escape.h"
+#include "ether-addr-util.h"
 #include "ethtool-util.h"
+#include "extract-word.h"
 #include "fd-util.h"
 #include "fileio.h"
+#include "hashmap.h"
 #include "link-config.h"
 #include "log-link.h"
 #include "memory-util.h"
 #include "net-condition.h"
+#include "netif-naming-scheme.h"
 #include "netif-sriov.h"
 #include "netif-util.h"
 #include "netlink-util.h"
 #include "network-util.h"
 #include "parse-util.h"
-#include "path-lookup.h"
 #include "path-util.h"
 #include "proc-cmdline.h"
 #include "random-util.h"
+#include "socket-util.h"
 #include "specifier.h"
 #include "stat-util.h"
 #include "string-table.h"
index dcbc61359c57221d54344517cf0b997440ba999f..4c50b13ec025cfb182daac4a01ce35f258f2bbff 100644 (file)
@@ -2,16 +2,12 @@
 #pragma once
 
 #include "sd-device.h"
-#include "sd-netlink.h"
 
-#include "condition.h"
-#include "conf-parser.h"
-#include "cpu-set-util.h"
+#include "ether-addr-util.h"
 #include "ethtool-util.h"
-#include "hashmap.h"
+#include "forward.h"
 #include "list.h"
 #include "net-condition.h"
-#include "netif-naming-scheme.h"
 
 typedef struct LinkConfigContext LinkConfigContext;
 typedef struct LinkConfig LinkConfig;
index 1b535ea3fe79c2e2d35eea3f56fe1bab855e60f3..ebb8ae9008be9010f75b68a61e1426d1163ef041 100644 (file)
@@ -4,7 +4,6 @@
 /* Copyright (C) IBM Corp. 2003 */
 
 #include <scsi/scsi.h>
-#include <sys/types.h>
 
 struct scsi_ioctl_command {
         unsigned inlen;        /* excluding scsi command length */
index 6ef93a6b9c212617967011ac570feb197da06511..5216455f41d5977e5cc9660778a28895e61f5c80 100644 (file)
@@ -5,15 +5,9 @@
  */
 
 #include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
 #include <getopt.h>
-#include <signal.h>
-#include <stdarg.h>
-#include <stdbool.h>
 #include <stdio.h>
-#include <sys/stat.h>
-#include <unistd.h>
+#include <stdlib.h>
 
 #include "alloc-util.h"
 #include "build.h"
@@ -21,7 +15,6 @@
 #include "extract-word.h"
 #include "fd-util.h"
 #include "fileio.h"
-#include "parse-util.h"
 #include "scsi_id.h"
 #include "string-util.h"
 #include "strv.h"
index 2d8792df247c99d081f8853464c284afc9584bd3..39937006154e78623003a7eabf2ed338f930c244 100644 (file)
@@ -5,24 +5,17 @@
  * Author: Patrick Mansfield<patmans@us.ibm.com>
  */
 
-#include <errno.h>
 #include <fcntl.h>
-#include <inttypes.h>
 #include <linux/bsg.h>
-#include <linux/types.h>
 #include <scsi/scsi.h>
 #include <scsi/sg.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
-#include <sys/types.h>
-#include <time.h>
 #include <unistd.h>
 
 #include "devnum-util.h"
 #include "log.h"
-#include "memory-util.h"
 #include "random-util.h"
 #include "scsi.h"
 #include "scsi_id.h"
index 265776d997e3c8d18df6640efa7d5301b98aeeaf..2ce7f196fdc60194b13ebfea9899d2b7963cbc56 100644 (file)
@@ -1,6 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include "log.h"
 #include "tests.h"
 #include "udev-builtin.h"
 
index 3371892ec40ceb902f7142a8d633ada473a04278..a78ab5365af1e7bd70cf56791b424928f22e1dc9 100644 (file)
@@ -3,12 +3,7 @@
   Copyright © 2003-2004 Greg Kroah-Hartman <greg@kroah.com>
 ***/
 
-#include <errno.h>
-#include <sched.h>
-#include <stdio.h>
-#include <stdlib.h>
 #include <sys/mount.h>
-#include <sys/signalfd.h>
 #include <unistd.h>
 
 #include "device-private.h"
@@ -24,6 +19,7 @@
 #include "signal-util.h"
 #include "string-util.h"
 #include "tests.h"
+#include "time-util.h"
 #include "udev-event.h"
 #include "udev-rules.h"
 #include "udev-spawn.h"
index e4c8f0c70d12b34438ab014a21eb6bb83fc078d8..73cfe7abc260427f402ac84e99f38fe80eafa1be 100644 (file)
@@ -1,8 +1,14 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
+#include <stdlib.h>
+
+#include "sd-device.h"
+
+#include "alloc-util.h"
 #include "mountpoint-util.h"
 #include "path-util.h"
 #include "signal-util.h"
+#include "string-util.h"
 #include "strv.h"
 #include "tests.h"
 #include "udev-event.h"
index 6cd738c3a5f44154e8970a863c0ab58c96d67874..c5d3e89c778f224ad70b2b60f583543545973e1a 100644 (file)
@@ -9,17 +9,12 @@
 #include <valgrind/memcheck.h>
 #endif
 
-#include <errno.h>
 #include <fcntl.h>
 #include <getopt.h>
 #include <linux/loop.h>
-#include <stdio.h>
-#include <stdlib.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
 
-#include "sd-id128.h"
-
 #include "alloc-util.h"
 #include "blkid-util.h"
 #include "blockdev-util.h"
@@ -28,8 +23,8 @@
 #include "efi-loader.h"
 #include "errno-util.h"
 #include "fd-util.h"
-#include "gpt.h"
 #include "initrd-util.h"
+#include "gpt.h"
 #include "parse-util.h"
 #include "string-util.h"
 #include "strv.h"
index 118b934b76793b5691900fbdef2f3b03b9c5960a..7a9dc7747c87ead4d769f4e3ebb8282069cfc29d 100644 (file)
@@ -2,15 +2,12 @@
 
 #include <fcntl.h>
 #include <linux/btrfs.h>
-#include <stdlib.h>
 #include <sys/ioctl.h>
 
 #include "device-util.h"
 #include "errno-util.h"
 #include "fd-util.h"
-#include "missing_fs.h"
 #include "string-util.h"
-#include "strxcpyx.h"
 #include "udev-builtin.h"
 
 static int builtin_btrfs(UdevEvent *event, int argc, char *argv[]) {
index 5d6b0d8fce3552df23067fb0a25687971b53b692..02aa8fcbea9f4eb6fb93b5fb4aff7797291ee254 100644 (file)
@@ -1,15 +1,19 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 
+#include <sys/file.h>
+
 #include "alloc-util.h"
 #include "blockdev-util.h"
 #include "device-util.h"
 #include "dissect-image.h"
-#include "fd-util.h"
+#include "errno-util.h"
 #include "hexdecoct.h"
 #include "image-policy.h"
 #include "initrd-util.h"
 #include "loop-util.h"
 #include "proc-cmdline.h"
+#include "string-util.h"
+#include "strv.h"
 #include "udev-builtin.h"
 
 static ImagePolicy *arg_image_policy = NULL;
index ffa06747720b9ae0b03bd6d85c7f5b1a4f36fd39..4c4db72d3da2667b01dcdfb77702d1cb1e8718a4 100644 (file)
@@ -2,6 +2,7 @@
 
 #include "device-util.h"
 #include "factory-reset.h"
+#include "string-util.h"
 #include "udev-builtin.h"
 
 /* Sometimes it is relevant in udev rules to know whether factory reset is currently in effect or not. Report
index 6e82ad8c755f815c9df5a99400427a5680f08e14..082af2e6031bd75d89eddd5320cb16823becc6d6 100644 (file)
@@ -1,10 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
 #include <fnmatch.h>
 #include <getopt.h>
 #include <stdio.h>
-#include <stdlib.h>
 
 #include "sd-hwdb.h"
 
index f8ac6d551790766496935d4821485467112b65f3..ecb2afe0488b58be4c3731edb99b120429e8d403 100644 (file)
@@ -6,12 +6,8 @@
  * Copyright © 2014 Carlos Garnacho <carlosg@gnome.org>
  */
 
-#include <errno.h>
 #include <fcntl.h>
 #include <linux/input.h>
-#include <linux/limits.h>
-#include <stdarg.h>
-#include <unistd.h>
 
 #include "device-util.h"
 #include "fd-util.h"
index e17fcbe74c878fe416026b1cce4c7c087bf8d8b8..a48a5500d14ec0eb366aed32c5ff1191de9aec4c 100644 (file)
@@ -1,6 +1,5 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
 #include <fcntl.h>
 #include <linux/input.h>
 #include <stdlib.h>
index 33031f7f40221a32bbcdfffea19a56ee79fbf2b3..4fe37971eeaa82335a1e36cfdd891e753cc824ed 100644 (file)
@@ -5,11 +5,6 @@
  * Copyright © 2011 ProFUSION embedded systems
  */
 
-#include <errno.h>
-#include <stdarg.h>
-#include <stdio.h>
-#include <stdlib.h>
-
 #include "device-util.h"
 #include "module-util.h"
 #include "string-util.h"
index 832ed6fdee7025211f08b5e3b9d14243d54d7cc9..2193243a9779d280967bb2b3a2baacd2a637435c 100644 (file)
@@ -6,8 +6,6 @@
 #include "errno-util.h"
 #include "ethtool-util.h"
 #include "fd-util.h"
-#include "log.h"
-#include "string-util.h"
 #include "udev-builtin.h"
 
 static int builtin_net_driver_set_driver(UdevEvent *event, int argc, char **argv) {
index a5ace58db63db36fe28739a30f79ba22261f4cfd..e3d8a3175d8850106c9d3badb24ef62cd01e0607 100644 (file)
  * When the code here is changed, man/systemd.net-naming-scheme.xml must be updated too.
  */
 
-#include <errno.h>
-#include <fcntl.h>
 #include <linux/if.h>
 #include <linux/if_arp.h>
 #include <linux/netdevice.h>
 #include <linux/pci_regs.h>
-#include <net/if.h>
-#include <stdarg.h>
 #include <unistd.h>
 
 #include "alloc-util.h"
-#include "chase.h"
 #include "device-private.h"
 #include "device-util.h"
 #include "dirent-util.h"
 #include "glyph-util.h"
 #include "netif-naming-scheme.h"
 #include "parse-util.h"
-#include "proc-cmdline.h"
 #include "stdio-util.h"
 #include "string-util.h"
-#include "strv.h"
-#include "strxcpyx.h"
 #include "udev-builtin.h"
 
 #define ONBOARD_14BIT_INDEX_MAX ((1U << 14) - 1)
index 0d59a72a062a03556d008f1996650d940cb9ea33..1277d0fb45c420c1246dc216d643b9344f5369bc 100644 (file)
@@ -1,13 +1,10 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include "alloc-util.h"
 #include "device-private.h"
 #include "device-util.h"
-#include "errno-util.h"
 #include "link-config.h"
 #include "log.h"
-#include "string-util.h"
-#include "strv.h"
+#include "netif-naming-scheme.h"
 #include "udev-builtin.h"
 
 static LinkConfigContext *ctx = NULL;
index 27897b461ff56cc67d549a17cffc9b83b86f516f..4db20e4a13f9c3495eb4bc799df5806a7acdb168 100644 (file)
@@ -5,14 +5,10 @@
  * Logic based on Hannes Reinecke's shell script.
  */
 
-#include <ctype.h>
-#include <errno.h>
-#include <fcntl.h>
 #include <getopt.h>
 #include <linux/usb/ch11.h>
-#include <stdarg.h>
 #include <stdio.h>
-#include <unistd.h>
+#include <stdlib.h>
 
 #include "alloc-util.h"
 #include "device-private.h"
 #include "fd-util.h"
 #include "parse-util.h"
 #include "string-util.h"
-#include "strv.h"
 #include "sysexits.h"
 #include "udev-builtin.h"
-#include "udev-util.h"
 
 _printf_(2,3)
 static void path_prepend(char **path, const char *fmt, ...) {
index 91d231c24e1450d578d7458adde1fb97aab51954..80597ea89ee258a276c118f8668dbacb94745136 100644 (file)
@@ -6,14 +6,10 @@
  *   Author: Hannes Reinecke <hare@suse.de>
  */
 
-#include <ctype.h>
-#include <errno.h>
 #include <fcntl.h>
-#include <stdarg.h>
 #include <stdio.h>
 #include <unistd.h>
 
-#include "alloc-util.h"
 #include "device-nodes.h"
 #include "device-util.h"
 #include "fd-util.h"
index 1467f36cd6d879d95371311f000c2dfcc000e9c5..62d43f8c79584df0e27976b1a5d8f9403f379e08 100644 (file)
@@ -1,13 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 #pragma once
 
-#include <stdbool.h>
-
-#include "sd-device.h"
-#include "sd-netlink.h"
-
-#include "macro.h"
-#include "udev-def.h"
+#include "forward.h"
 #include "udev-event.h"
 
 typedef struct UdevBuiltin {
index ef0ee0abd691206ba7089c66fc14fa2ad14f7517..600803f93ccbea48de075f3e0c9ffbc0a0421685 100644 (file)
@@ -1,20 +1,24 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 
 #include <getopt.h>
-#include <unistd.h>
+#include <stdlib.h>
 
 #include "conf-parser.h"
 #include "cpu-set-util.h"
 #include "daemon-util.h"
 #include "fd-util.h"
 #include "fileio.h"
+#include "hashmap.h"
 #include "limits-util.h"
 #include "parse-util.h"
 #include "pretty-print.h"
 #include "proc-cmdline.h"
 #include "serialize.h"
 #include "signal-util.h"
+#include "string-util.h"
+#include "strv.h"
 #include "syslog-util.h"
+#include "time-util.h"
 #include "udev-config.h"
 #include "udev-manager.h"
 #include "udev-rules.h"
index 127b3b9a1be0b93db3173cd7a39918c65ed3091b..61fc693ca194aef144a52974ddf35dc059a88972 100644 (file)
@@ -1,15 +1,11 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 #pragma once
 
-#include <stdbool.h>
-
-#include "time-util.h"
 #include "udev-def.h"
+#include "udev-forward.h"
 
 extern bool arg_daemonize;
 
-typedef struct Manager Manager;
-
 typedef struct UdevConfig {
         int log_level;
         ResolveNameTiming resolve_name_timing;
index 10dd48164a2116210fb8e1cf090b83eda1b33ea4..5cde769b1f62a94fbe287202a37cc282a18de036 100644 (file)
@@ -1,10 +1,6 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
-#include <errno.h>
 #include <poll.h>
-#include <stddef.h>
-#include <stdlib.h>
-#include <string.h>
 #include <sys/un.h>
 #include <unistd.h>
 
index 0339d33d576147996963b4ca7af6cc7c51091c26..efd500fd50c0dd6723d95d947b8d197083dd3b55 100644 (file)
@@ -1,13 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 #pragma once
 
-#include "sd-event.h"
-
-#include "macro.h"
-#include "memory-util.h"
-#include "time-util.h"
-
-typedef struct UdevCtrl UdevCtrl;
+#include "udev-forward.h"
 
 typedef enum UdevCtrlMessageType {
         _UDEV_CTRL_END_MESSAGES,
index d744f959ae918edec0499c4ddc5e2a38d386443b..836dd7045460aff12431b8d2a62944865a31352e 100644 (file)
@@ -1,9 +1,8 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 #pragma once
 
-#include <errno.h>
-
 #include "env-util.h"
+#include "udev-forward.h"
 
 #define UDEV_NAME_SIZE   512
 #define UDEV_PATH_SIZE  1024
index accca6df7f6e4888edabafb6564088f13fd38cd8..d5e420d120b14ea7cd46134a686c2879f4ef4913 100644 (file)
@@ -6,9 +6,9 @@
 #include "device-util.h"
 #include "devnum-util.h"
 #include "format-util.h"
-#include "fs-util.h"
+#include "hashmap.h"
 #include "json-util.h"
-#include "parse-util.h"
+#include "string-util.h"
 #include "strv.h"
 #include "udev-builtin.h"
 #include "udev-dump.h"
index f64499b6531574a1aaf6bf84bcee9b6dd8665d68..dd58999cd9777419f64315766ca4f6e3e8f4bf80 100644 (file)
@@ -1,11 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 #pragma once
 
-#include <stdio.h>
-
-#include "sd-json.h"
-
-typedef struct UdevEvent UdevEvent;
+#include "udev-forward.h"
 
 void event_cache_written_sysattr(UdevEvent *event, const char *attr, const char *value);
 void event_cache_written_sysctl(UdevEvent *event, const char *attr, const char *value);
index ad3a03384a5b096c1dbb1bef3066499f1c9cb105..b7cadbd9a49938f2df7c92d4f8bb127846b61388 100644 (file)
@@ -16,7 +16,7 @@ int device_add_errno(sd_device *dev, int error) {
         if (error == 0)
                 return 0;
 
-        error = abs(error);
+        error = ABS(error);
 
         r = device_add_property(dev, "UDEV_WORKER_FAILED", "1");
         RET_GATHER(r, device_add_propertyf(dev, "UDEV_WORKER_ERRNO", "%i", error));
index bc38004ea18a777fd9c46ca551e24030d13e0ee3..96f9134e68ef132c045ae877d2823433f6d2a4ff 100644 (file)
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 #pragma once
 
-#include "sd-device.h"
+#include "forward.h"
 
 int device_add_errno(sd_device *dev, int error);
 int device_add_exit_status(sd_device *dev, int status);
index d8bdf835b21d669518c972f776be74402ce74c24..2cc6c04a2c531828bd6db9ac00deef0dbc5cebf1 100644 (file)
@@ -1,15 +1,19 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 
+#include "sd-netlink.h"
+
 #include "alloc-util.h"
 #include "device-internal.h"
 #include "device-private.h"
 #include "device-util.h"
-#include "fs-util.h"
+#include "hashmap.h"
 #include "netif-naming-scheme.h"
 #include "netlink-util.h"
 #include "path-util.h"
+#include "socket-util.h"
 #include "string-util.h"
 #include "strv.h"
+#include "time-util.h"
 #include "udev-event.h"
 #include "udev-node.h"
 #include "udev-rules.h"
index d18fb0978bf1dffef456986fa36bd5d84fbc0fea..61915ecf602dd69fbfa6878d883df8781a021ade 100644 (file)
@@ -5,20 +5,8 @@
  * Copyright © 2003 Greg Kroah-Hartman <greg@kroah.com>
  */
 
-#include <stdbool.h>
-#include <stddef.h>
-
-#include "sd-device.h"
-#include "sd-netlink.h"
-
-#include "hashmap.h"
-#include "macro.h"
-#include "time-util.h"
 #include "udev-def.h"
-#include "user-util.h"
-
-typedef struct UdevRules UdevRules;
-typedef struct UdevWorker UdevWorker;
+#include "udev-forward.h"
 
 typedef struct UdevEvent {
         unsigned n_ref;
index 8da68ea86b89cf7990ec0bfc4230ecac0ea92510..d670ee129fdd91572a767745f203d58d1152fb34 100644 (file)
@@ -1,5 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 
+#include <sys/sysmacros.h>
+
 #include "alloc-util.h"
 #include "device-util.h"
 #include "errno-util.h"
index 9914dc03b2d133a524ba5f80e4764fef8e54f084..918b497c0b52c26370d62446b87637c75da68d30 100644 (file)
@@ -1,10 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 #pragma once
 
-#include <stdbool.h>
-#include <stddef.h>
-
-typedef struct UdevEvent UdevEvent;
+#include "udev-forward.h"
 
 #define UDEV_ALLOWED_CHARS_INPUT        "/ $%?,"
 
diff --git a/src/udev/udev-forward.h b/src/udev/udev-forward.h
new file mode 100644 (file)
index 0000000..3d0079f
--- /dev/null
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: LGPL-2.1-or-later */
+#pragma once
+
+#include "forward.h" /* IWYU pragma: export */
+
+typedef struct UdevCtrl UdevCtrl;
+typedef struct UdevEvent UdevEvent;
+typedef struct Manager Manager;
+typedef struct Event Event;
+typedef struct UdevRules UdevRules;
+typedef struct Worker Worker;
+typedef struct UdevWorker UdevWorker;
+typedef struct UdevRuleFile UdevRuleFile;
index 507072ce278feb6a9ed1cbdfd54cbae4b24e1695..270a63e861b6e898b72b945bfe5283bb2d2d8e99 100644 (file)
@@ -1,7 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 #pragma once
 
-typedef struct Manager Manager;
+#include "udev-forward.h"
 
 int manager_init_ctrl(Manager *manager, int fd);
 int manager_start_ctrl(Manager *manager);
index 8d0d6d58586323db45fdaf1311ed363e9a74cdba..f92a186dd4ae0aeb6a86026a75fb4b15b54ee9d3 100644 (file)
@@ -1,36 +1,41 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 
+#include <poll.h>
+#include <stdlib.h>
+
+#include "sd-varlink.h"
+
 #include "cgroup-util.h"
 #include "common-signal.h"
 #include "daemon-util.h"
 #include "device-monitor-private.h"
 #include "device-private.h"
 #include "device-util.h"
-#include "errno-list.h"
+#include "errno-util.h"
 #include "event-util.h"
 #include "fd-util.h"
+#include "format-util.h"
 #include "fs-util.h"
 #include "hashmap.h"
 #include "io-util.h"
-#include "iovec-util.h"
 #include "list.h"
-#include "mkdir.h"
 #include "notify-recv.h"
+#include "pidref.h"
+#include "prioq.h"
 #include "process-util.h"
 #include "selinux-util.h"
+#include "set.h"
 #include "signal-util.h"
 #include "socket-util.h"
 #include "string-util.h"
 #include "strv.h"
-#include "syslog-util.h"
+#include "time-util.h"
 #include "udev-builtin.h"
 #include "udev-config.h"
 #include "udev-ctrl.h"
 #include "udev-error.h"
-#include "udev-event.h"
 #include "udev-manager.h"
 #include "udev-manager-ctrl.h"
-#include "udev-node.h"
 #include "udev-rules.h"
 #include "udev-spawn.h"
 #include "udev-trace.h"
index d59ab0eb368ec33066ab3260906c53366a3dfdf2..2a384dcfaa22f7f4ad9ad187ccdaf607042a8a70 100644 (file)
@@ -1,20 +1,12 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 #pragma once
 
-#include <stdbool.h>
-
-#include "sd-device.h"
 #include "sd-event.h"
-#include "sd-varlink.h"
 
-#include "hashmap.h"
+#include "forward.h"
 #include "list.h"
-#include "macro.h"
-#include "prioq.h"
-#include "time-util.h"
 #include "udev-config.h"
-#include "udev-ctrl.h"
-#include "udev-def.h"
+#include "udev-forward.h"
 
 /* This should have a higher priority than the device monitor and inotify watch, to make device monitor and
  * inotify event source stopped as soon as possible when the signal is received. Otherwise, we may continue
 /* The event is intended to trigger the post-event source, hence can be the lowest priority. */
 #define EVENT_PRIORITY_REQUEUE_EVENT  (SD_EVENT_PRIORITY_NORMAL + 3)
 
-typedef struct Event Event;
-typedef struct UdevRules UdevRules;
-typedef struct Worker Worker;
-
 typedef struct Manager {
         sd_event *event;
         Hashmap *workers;
index 957f028f1716491244169bbdcb0437d567851626..5f165b5107a02af6f80014f6a05df2f7da97b08f 100644 (file)
@@ -1,6 +1,8 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 
 #include <sys/file.h>
+#include <sys/stat.h>
+#include <unistd.h>
 
 #include "sd-id128.h"
 
 #include "fileio.h"
 #include "format-util.h"
 #include "fs-util.h"
+#include "hashmap.h"
 #include "hexdecoct.h"
 #include "label-util.h"
 #include "mkdir-label.h"
 #include "parse-util.h"
 #include "path-util.h"
 #include "selinux-util.h"
+#include "siphash24.h"
 #include "smack-util.h"
-#include "stat-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "udev-node.h"
index 86a829545a533138087cb9f2f3e14d69612f6fab..8a0a72f0e8794196d86d227f02e9eade544885b0 100644 (file)
@@ -1,12 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 #pragma once
 
-#include <stdbool.h>
-#include <sys/types.h>
-
-#include "sd-device.h"
-
-#include "hashmap.h"
+#include "forward.h"
 
 int udev_node_apply_permissions(
                 sd_device *dev,
index 4555219765c10f4bc224d21cca8b63ef7d0be95b..74787b72ba375181a351d01a4b619f7613e0a800 100644 (file)
@@ -2,9 +2,11 @@
 
 #include <ctype.h>
 #include <fnmatch.h>
+#include <unistd.h>
 
 #include "alloc-util.h"
 #include "architecture.h"
+#include "chase.h"
 #include "conf-files.h"
 #include "conf-parser.h"
 #include "confidential-virt.h"
@@ -12,6 +14,7 @@
 #include "device-private.h"
 #include "device-util.h"
 #include "dirent-util.h"
+#include "errno-util.h"
 #include "escape.h"
 #include "extract-word.h"
 #include "fd-util.h"
@@ -19,9 +22,9 @@
 #include "format-util.h"
 #include "fs-util.h"
 #include "glob-util.h"
+#include "hashmap.h"
 #include "list.h"
 #include "memstream-util.h"
-#include "mkdir.h"
 #include "netif-naming-scheme.h"
 #include "nulstr-util.h"
 #include "parse-util.h"
@@ -30,6 +33,7 @@
 #include "socket-util.h"
 #include "stat-util.h"
 #include "string-table.h"
+#include "string-util.h"
 #include "strv.h"
 #include "strxcpyx.h"
 #include "sysctl-util.h"
@@ -44,6 +48,8 @@
 #include "udev-trace.h"
 #include "udev-util.h"
 #include "udev-worker.h"
+#include "user-record.h"
+#include "user-util.h"
 #include "userdb.h"
 #include "virt.h"
 
index 62dac5ba73b1c0098eca5173ebb08b315bead574..d0ed2adf00e1ec4cfbb465beaa94d8ba81c0ef5d 100644 (file)
@@ -1,14 +1,8 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 #pragma once
 
-#include "alloc-util.h"
-#include "hashmap.h"
-#include "time-util.h"
 #include "udev-def.h"
-
-typedef struct UdevRuleFile UdevRuleFile;
-typedef struct UdevRules UdevRules;
-typedef struct UdevEvent UdevEvent;
+#include "udev-forward.h"
 
 int udev_rule_parse_value(char *str, char **ret_value, char **ret_endpos, bool *ret_is_case_insensitive);
 int udev_rules_parse_file(UdevRules *rules, const char *filename, bool extra_checks, UdevRuleFile **ret);
index 0e3ff2e104644679f915e76d8e13cc5afba1ff0e..bbbbd4e2fc85133bd9960bb04e49f89608ed1fbf 100644 (file)
@@ -9,11 +9,15 @@
 #include "exec-util.h"
 #include "extract-word.h"
 #include "fd-util.h"
+#include "format-util.h"
+#include "hashmap.h"
 #include "path-util.h"
+#include "pidref.h"
 #include "process-util.h"
 #include "signal-util.h"
 #include "string-util.h"
 #include "strv.h"
+#include "time-util.h"
 #include "udev-builtin.h"
 #include "udev-event.h"
 #include "udev-spawn.h"
index 6b22b68b24f4f4d3b63e6138cd193b3405b481f0..dceab8571006a4289ae07a81c11fef2245e21924 100644 (file)
@@ -1,17 +1,11 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 #pragma once
 
-#include <stdbool.h>
-#include <stddef.h>
-
-#include "macro.h"
-#include "time-util.h"
+#include "udev-forward.h"
 
 #define READ_END  0
 #define WRITE_END 1
 
-typedef struct UdevEvent UdevEvent;
-
 int udev_event_spawn(
                 UdevEvent *event,
                 bool accept_failure,
index 5e943908542fdd85ac8abeb76c13b2372fadf872..a8ec6dabe99442492fe6f3c19723811db7fcf511 100644 (file)
@@ -8,6 +8,7 @@
 #include "device-private.h"
 #include "device-util.h"
 #include "errno-util.h"
+#include "forward.h"
 
 /* Each trace point can have different number of additional arguments. Note that when the macro is used only
  * additional arguments are listed in the macro invocation!
index 5c0a97be3dafa0f61f096c920cb34493d6c0e45d..5228d3512c9435dd0da72da680b9728ad8f488f4 100644 (file)
@@ -2,6 +2,7 @@
 
 #include "json-util.h"
 #include "log.h"
+#include "string-util.h"
 #include "strv.h"
 #include "udev-manager.h"
 #include "udev-varlink.h"
index 759a4460ab6d64256e709b0e9d39c7872687b691..080f7c95a7520a45ecfe43d926cfa2c192e2375e 100644 (file)
@@ -1,11 +1,7 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 #pragma once
 
-#include "sd-varlink.h"
-
-#include "time-util.h"
-
-typedef struct Manager Manager;
+#include "udev-forward.h"
 
 int manager_start_varlink_server(Manager *manager);
 int udev_varlink_connect(sd_varlink **ret, usec_t timeout);
index 01f16db63c067d1c4e2f8530a13c80f85b49dc3c..93d51d461b8e781b86dc23f0ccb5a9fe1b9e4698 100644 (file)
@@ -4,6 +4,9 @@
  * Copyright © 2009 Scott James Remnant <scott@netsplit.com>
  */
 
+#include <sys/signalfd.h>
+#include <sys/wait.h>
+
 #include "alloc-util.h"
 #include "blockdev-util.h"
 #include "daemon-util.h"
 #include "errno-util.h"
 #include "event-util.h"
 #include "fd-util.h"
+#include "format-util.h"
 #include "fs-util.h"
 #include "inotify-util.h"
-#include "mkdir.h"
 #include "parse-util.h"
+#include "pidref.h"
 #include "process-util.h"
 #include "rm-rf.h"
 #include "set.h"
index 71945e06af0e7d6ae03724e8ad79f2fcc035fdea..821f5ca20b5c17aaf7befb47940c8296a71e1ce2 100644 (file)
@@ -1,10 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 #pragma once
 
-#include "sd-device.h"
-
-typedef struct Manager Manager;
-typedef struct UdevWorker UdevWorker;
+#include "udev-forward.h"
 
 void udev_watch_dump(void);
 
index 1f00606d87c055f5979c70ea9dcea3780ba525ad..4bcadfa1e75dd1eca78eb5ba7731c0129179d1de 100644 (file)
@@ -1,24 +1,22 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 
+#include <linux/fs.h>
 #include <sys/file.h>
 #include <sys/ioctl.h>
-#include <sys/mount.h>
 
 #include "sd-daemon.h"
+#include "sd-event.h"
+#include "sd-netlink.h"
 
-#include "alloc-util.h"
 #include "blockdev-util.h"
-#include "common-signal.h"
 #include "device-monitor-private.h"
 #include "device-private.h"
 #include "device-util.h"
+#include "errno-list.h"
 #include "errno-util.h"
 #include "fd-util.h"
-#include "path-util.h"
+#include "hashmap.h"
 #include "process-util.h"
-#include "signal-util.h"
-#include "string-util.h"
-#include "strv.h"
 #include "udev-error.h"
 #include "udev-event.h"
 #include "udev-rules.h"
index 356084194e0a1e09e9343c9022266667e3da8447..fa67d60b5fc1c805c5d5a85802e2ff6f1a695666 100644 (file)
@@ -1,22 +1,12 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 #pragma once
 
-#include <stdbool.h>
-
-#include "sd-device.h"
-#include "sd-event.h"
-#include "sd-netlink.h"
-
-#include "errno-list.h"
-#include "hashmap.h"
-#include "time-util.h"
 #include "udev-config.h"
+#include "udev-forward.h"
 
 #define DEFAULT_WORKER_TIMEOUT_USEC (3 * USEC_PER_MINUTE)
 #define MIN_WORKER_TIMEOUT_USEC     (1 * USEC_PER_MSEC)
 
-typedef struct UdevRules UdevRules;
-
 typedef struct UdevWorker {
         sd_event *event;
         sd_netlink *rtnl;
index 8b665366177eb85a6dabec52ba5115eff56c9bb5..c49524a4fea528c00f9d1e64b22dd419f836959b 100644 (file)
@@ -1,19 +1,14 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 
-#include <errno.h>
 #include <getopt.h>
-#include <stddef.h>
 #include <stdio.h>
-#include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
 
 #include "creds-util.h"
 #include "errno-util.h"
 #include "log.h"
 #include "parse-argument.h"
 #include "parse-util.h"
-#include "process-util.h"
 #include "static-destruct.h"
 #include "strv.h"
 #include "syslog-util.h"
index d5a4b39cc8f52b8ec20e9e1198db0170aa75117c..b84ebea162f73e073dad761e6e844b416ff5173d 100644 (file)
@@ -1,8 +1,8 @@
 /* SPDX-License-Identifier: LGPL-2.1-or-later */
 
 #include <getopt.h>
+#include <stdio.h>
 
-#include "assert-util.h"
 #include "hwdb-util.h"
 #include "log.h"
 #include "udevadm.h"
index f505680dbd70820f8190c6f8ccf8ab3c3dec32b0..ccfc83cce4e9017eac7cb16eae1b9d269ec7307f 100644 (file)
@@ -1,12 +1,11 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 
 #include <ctype.h>
-#include <errno.h>
 #include <fcntl.h>
 #include <getopt.h>
-#include <stddef.h>
 #include <stdio.h>
 #include <sys/stat.h>
+#include <sys/sysmacros.h>
 #include <unistd.h>
 
 #include "sd-device.h"
 #include "device-enumerator-private.h"
 #include "device-private.h"
 #include "device-util.h"
-#include "devnum-util.h"
 #include "dirent-util.h"
 #include "errno-util.h"
-#include "extract-word.h"
 #include "fd-util.h"
 #include "fileio.h"
 #include "glyph-util.h"
@@ -31,7 +28,7 @@
 #include "string-table.h"
 #include "string-util.h"
 #include "strv.h"
-#include "terminal-util.h"
+#include "time-util.h"
 #include "udev-util.h"
 #include "udevadm.h"
 #include "udevadm-util.h"
index 9b495fda3c40232a146d5c627f9314e88d1af81a..00f4deafd68a6b3c15ac169c22cfdd8284a16983 100644 (file)
@@ -1,23 +1,23 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 
 #include <getopt.h>
-#include <stdlib.h>
 #include <sys/file.h>
+#include <sys/stat.h>
 #include <unistd.h>
 
 #include "blockdev-util.h"
-#include "btrfs-util.h"
 #include "device-util.h"
 #include "fd-util.h"
 #include "fdset.h"
+#include "hash-funcs.h"
 #include "lock-util.h"
-#include "main-func.h"
-#include "parse-util.h"
 #include "path-util.h"
+#include "pidref.h"
 #include "pretty-print.h"
 #include "process-util.h"
 #include "signal-util.h"
 #include "sort-util.h"
+#include "static-destruct.h"
 #include "strv.h"
 #include "time-util.h"
 #include "udevadm.h"
index b411d45b6dbc9a8d354156f8167ee50ff2f036a7..95fe65ff9d1525811e2f25d33fb3c5be5aecd6f3 100644 (file)
@@ -1,6 +1,5 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 
-#include <errno.h>
 #include <getopt.h>
 
 #include "sd-device.h"
@@ -10,11 +9,9 @@
 #include "device-monitor-private.h"
 #include "device-private.h"
 #include "device-util.h"
-#include "fd-util.h"
 #include "format-util.h"
 #include "hashmap.h"
 #include "set.h"
-#include "signal-util.h"
 #include "static-destruct.h"
 #include "string-util.h"
 #include "time-util.h"
index 9d6ec684f3db1f0f69148e0f9405fa5dd6b18e4f..ff9cd5f02c08cff3e1c96c5c47d3e8e9d0ccc094 100644 (file)
@@ -15,6 +15,7 @@
 #include "alloc-util.h"
 #include "bus-util.h"
 #include "path-util.h"
+#include "string-util.h"
 #include "strv.h"
 #include "time-util.h"
 #include "udev-util.h"
index a75e2432477228d3b486b184795424396fda9e47..a1ad9cb32038403e58e7c3b25e7438f5cc4ace36 100644 (file)
@@ -1,10 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 
-#include <errno.h>
 #include <getopt.h>
-#include <stddef.h>
 #include <stdio.h>
-#include <stdlib.h>
 
 #include "device-private.h"
 #include "device-util.h"
index 7b5fdb59ce0e71b32184da85b50511d496b3836c..6380aec36df0d9ff2b8a550bbfaed281e70bae24 100644 (file)
@@ -8,7 +8,9 @@
 #include <stdio.h>
 
 #include "sd-device.h"
+#include "sd-json.h"
 
+#include "alloc-util.h"
 #include "device-private.h"
 #include "log.h"
 #include "parse-argument.h"
index 94a3a4037a91dcd7bcd6bfc6b35eec488a7e71c8..cfc157ce2790cd99dcb69a9ced9a86615cbabe57 100644 (file)
@@ -1,25 +1,21 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 
-#include <errno.h>
 #include <getopt.h>
+#include <stdio.h>
 
 #include "sd-device.h"
 #include "sd-event.h"
 
+#include "alloc-util.h"
 #include "device-enumerator-private.h"
 #include "device-private.h"
 #include "device-util.h"
-#include "fd-util.h"
-#include "fileio.h"
 #include "id128-util.h"
-#include "parse-util.h"
-#include "path-util.h"
-#include "process-util.h"
 #include "set.h"
 #include "static-destruct.h"
 #include "string-table.h"
-#include "string-util.h"
 #include "strv.h"
+#include "time-util.h"
 #include "udevadm.h"
 #include "udevadm-util.h"
 #include "virt.h"
index e3ea2879cf0c855901295c4ac18ca27f72da475b..09fb24f6e5b829624f5b8d60b93e8b0ea8679353 100644 (file)
@@ -1,6 +1,8 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 
-#include <errno.h>
+#include <getopt.h>
+
+#include "sd-bus.h"
 
 #include "alloc-util.h"
 #include "bus-error.h"
 #include "conf-files.h"
 #include "constants.h"
 #include "device-private.h"
+#include "errno-util.h"
+#include "extract-word.h"
 #include "log.h"
 #include "path-util.h"
+#include "stat-util.h"
 #include "string-table.h"
+#include "string-util.h"
 #include "strv.h"
 #include "udev-ctrl.h"
 #include "udev-rules.h"
 #include "udev-varlink.h"
 #include "udevadm-util.h"
+#include "unit-def.h"
 #include "unit-name.h"
 #include "varlink-util.h"
 
index c75a2c39300fff6e9972fcc8efefb9b26656c8e6..9b41109df86fc43af2cc170046a9056e3bdf266f 100644 (file)
@@ -3,7 +3,7 @@
 
 #include "sd-device.h"
 
-#include "time-util.h"
+#include "forward.h"
 #include "udev-def.h"
 
 int find_device(const char *id, const char *prefix, sd_device **ret);
index ca2e0e472cf116f0d885a0291a8e474896f2e49c..ac46a56463d0c76973cd19b5f5235e665f9be161 100644 (file)
@@ -1,12 +1,9 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 
-#include <errno.h>
 #include <getopt.h>
-#include <stddef.h>
 #include <stdio.h>
-#include <stdlib.h>
-#include <unistd.h>
 
+#include "alloc-util.h"
 #include "errno-util.h"
 #include "log.h"
 #include "parse-argument.h"
index c93039895b6c630f8b8902ded93356be3203ea1a..70b14a7e91e913fd21fff1ed0d65bf01911a49cd 100644 (file)
@@ -1,24 +1,23 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 
 #include <getopt.h>
+#include <stdio.h>
+#include <sys/inotify.h>
 #include <unistd.h>
 
 #include "sd-event.h"
 
-#include "alloc-util.h"
-#include "chase.h"
 #include "device-monitor-private.h"
 #include "device-util.h"
-#include "errno-util.h"
 #include "event-util.h"
-#include "fd-util.h"
 #include "fs-util.h"
-#include "inotify-util.h"
 #include "parse-util.h"
 #include "path-util.h"
 #include "static-destruct.h"
 #include "string-table.h"
+#include "string-util.h"
 #include "strv.h"
+#include "time-util.h"
 #include "udev-util.h"
 #include "udevadm.h"
 
index c9e9a354a88ac20fb3d020f5681a684a4dbb18fd..3a91d14ef8e93826cf3d7fcaa47f6d9975671829 100644 (file)
@@ -1,17 +1,13 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 
-#include <errno.h>
 #include <getopt.h>
-#include <stddef.h>
 #include <stdio.h>
 
 #include "alloc-util.h"
 #include "argv-util.h"
+#include "label-util.h"
 #include "main-func.h"
 #include "pretty-print.h"
-#include "process-util.h"
-#include "selinux-util.h"
-#include "string-util.h"
 #include "udev-util.h"
 #include "udevadm.h"
 #include "udevd.h"
@@ -89,6 +85,12 @@ static int parse_argv(int argc, char *argv[]) {
         return 1; /* work to do */
 }
 
+int print_version(void) {
+        /* Dracut relies on the version being a single integer */
+        puts(PROJECT_VERSION_STR);
+        return 0;
+}
+
 static int version_main(int argc, char *argv[], void *userdata) {
         return print_version();
 }
index 665d2f46b37dcc5eca4470063d1e46372cc75a58..58c57fee109d80832681f2f542ff35d4bac076ae 100644 (file)
@@ -1,9 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */
 #pragma once
 
-#include <stdio.h>
-
-#include "macro.h"
+#include "forward.h"
 
 int cat_main(int argc, char *argv[], void *userdata);
 int info_main(int argc, char *argv[], void *userdata);
@@ -18,8 +16,4 @@ int verify_main(int argc, char *argv[], void *userdata);
 int wait_main(int argc, char *argv[], void *userdata);
 int lock_main(int argc, char *argv[], void *userdata);
 
-static inline int print_version(void) {
-        /* Dracut relies on the version being a single integer */
-        puts(PROJECT_VERSION_STR);
-        return 0;
-}
+int print_version(void);
index cf3e66327736799730af21dff66b28b08c9d0db7..fd16654127ea3bead9521198fa87b396508b1a32 100644 (file)
@@ -5,15 +5,15 @@
  * Copyright © 2009 Scott James Remnant <scott@netsplit.com>
  */
 
+#include <sys/stat.h>
 #include <unistd.h>
 
 #include "errno-util.h"
 #include "fd-util.h"
+#include "label-util.h"
 #include "log.h"
-#include "mkdir.h"
 #include "process-util.h"
 #include "rlimit-util.h"
-#include "selinux-util.h"
 #include "terminal-util.h"
 #include "udev-config.h"
 #include "udev-manager.h"
index 312a8233b104ec62458e802cd350647f7cb2363b..6c37d7c38d6c2c741202824634db5b8d724b51b9 100644 (file)
@@ -3,18 +3,11 @@
  * Copyright (c) 2009 Filippo Argiolas <filippo.argiolas@gmail.com>
  */
 
-#include <ctype.h>
-#include <errno.h>
 #include <fcntl.h>
 #include <getopt.h>
 #include <linux/videodev2.h>
 #include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
 #include <sys/ioctl.h>
-#include <sys/time.h>
-#include <sys/types.h>
-#include <unistd.h>
 
 #include "build.h"
 #include "fd-util.h"