diff options
Diffstat (limited to 'src')
128 files changed, 481 insertions, 135 deletions
diff --git a/src/basic/af-list.c b/src/basic/af-list.c index 07dfff6ad4..606bb49a59 100644 --- a/src/basic/af-list.c +++ b/src/basic/af-list.c @@ -23,7 +23,7 @@ #include <sys/socket.h> #include "af-list.h" -#include "util.h" +#include "macro.h" static const struct af_name* lookup_af(register const char *str, register unsigned int len); diff --git a/src/basic/alloc-util.c b/src/basic/alloc-util.c index 48183e381f..0c6a15c958 100644 --- a/src/basic/alloc-util.c +++ b/src/basic/alloc-util.c @@ -19,7 +19,11 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <stdint.h> +#include <string.h> + #include "alloc-util.h" +#include "macro.h" #include "util.h" void* memdup(const void *p, size_t l) { diff --git a/src/basic/alloc-util.h b/src/basic/alloc-util.h index 12b602e185..f5097ea117 100644 --- a/src/basic/alloc-util.h +++ b/src/basic/alloc-util.h @@ -22,6 +22,7 @@ ***/ #include <alloca.h> +#include <stddef.h> #include <stdlib.h> #include <string.h> diff --git a/src/basic/arphrd-list.c b/src/basic/arphrd-list.c index 03d8ad7403..c1fdbbd905 100644 --- a/src/basic/arphrd-list.c +++ b/src/basic/arphrd-list.c @@ -23,7 +23,7 @@ #include <string.h> #include "arphrd-list.h" -#include "util.h" +#include "macro.h" static const struct arphrd_name* lookup_arphrd(register const char *str, register unsigned int len); diff --git a/src/basic/async.c b/src/basic/async.c index cfc5d224e1..42c66a762e 100644 --- a/src/basic/async.c +++ b/src/basic/async.c @@ -19,12 +19,15 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> #include <pthread.h> +#include <stddef.h> #include <unistd.h> #include "async.h" #include "fd-util.h" #include "log.h" +#include "macro.h" #include "util.h" int asynchronous_job(void* (*func)(void *p), void *arg) { diff --git a/src/basic/audit-util.c b/src/basic/audit-util.c index 4612297334..e52ee24c05 100644 --- a/src/basic/audit-util.c +++ b/src/basic/audit-util.c @@ -20,7 +20,9 @@ ***/ #include <errno.h> +#include <linux/netlink.h> #include <stdio.h> +#include <sys/socket.h> #include "alloc-util.h" #include "audit-util.h" @@ -30,7 +32,6 @@ #include "parse-util.h" #include "process-util.h" #include "user-util.h" -#include "util.h" int audit_session_from_pid(pid_t pid, uint32_t *id) { _cleanup_free_ char *s = NULL; diff --git a/src/basic/barrier.c b/src/basic/barrier.c index 2d55bab4ab..9a78a80eb2 100644 --- a/src/basic/barrier.c +++ b/src/basic/barrier.c @@ -32,7 +32,6 @@ #include "barrier.h" #include "fd-util.h" #include "macro.h" -#include "util.h" /** * Barriers diff --git a/src/basic/barrier.h b/src/basic/barrier.h index b8954694d3..722effe834 100644 --- a/src/basic/barrier.h +++ b/src/basic/barrier.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <stdbool.h> +#include <stdint.h> #include <sys/types.h> #include "macro.h" diff --git a/src/basic/bitmap.c b/src/basic/bitmap.c index 1449e2ea85..95f59e400a 100644 --- a/src/basic/bitmap.c +++ b/src/basic/bitmap.c @@ -19,9 +19,16 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> +#include <stddef.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> + #include "alloc-util.h" #include "bitmap.h" -#include "util.h" +#include "hashmap.h" +#include "macro.h" struct Bitmap { uint64_t *bitmaps; diff --git a/src/basic/bitmap.h b/src/basic/bitmap.h index 9ce7b42d00..d2726630f1 100644 --- a/src/basic/bitmap.h +++ b/src/basic/bitmap.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <stdbool.h> + #include "hashmap.h" #include "macro.h" diff --git a/src/basic/btrfs-util.c b/src/basic/btrfs-util.c index be40dc5702..1aff9d5329 100644 --- a/src/basic/btrfs-util.c +++ b/src/basic/btrfs-util.c @@ -19,9 +19,20 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> +#include <fcntl.h> +#include <inttypes.h> +#include <linux/loop.h> +#include <stddef.h> +#include <stdio.h> #include <stdlib.h> +#include <string.h> +#include <sys/ioctl.h> #include <sys/stat.h> -#include <sys/vfs.h> +#include <sys/statfs.h> +#include <sys/sysmacros.h> +#include <unistd.h> + #ifdef HAVE_LINUX_BTRFS_H #include <linux/btrfs.h> #endif @@ -37,6 +48,8 @@ #include "path-util.h" #include "selinux-util.h" #include "smack-util.h" +#include "sparse-endian.h" +#include "time-util.h" #include "stat-util.h" #include "string-util.h" #include "util.h" diff --git a/src/basic/btrfs-util.h b/src/basic/btrfs-util.h index 8c11ce35d2..31b9c02785 100644 --- a/src/basic/btrfs-util.h +++ b/src/basic/btrfs-util.h @@ -22,8 +22,11 @@ #pragma once #include <stdbool.h> +#include <stdint.h> #include <sys/types.h> +#include "sd-id128.h" + #include "time-util.h" typedef struct BtrfsSubvolInfo { diff --git a/src/basic/bus-label.c b/src/basic/bus-label.c index c1534657ac..d8d5863b03 100644 --- a/src/basic/bus-label.c +++ b/src/basic/bus-label.c @@ -25,7 +25,6 @@ #include "bus-label.h" #include "hexdecoct.h" #include "macro.h" -#include "util.h" char *bus_label_escape(const char *s) { char *r, *t; diff --git a/src/basic/bus-label.h b/src/basic/bus-label.h index ed1dc4e0a7..f51153ce6d 100644 --- a/src/basic/bus-label.h +++ b/src/basic/bus-label.h @@ -21,6 +21,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <stddef.h> #include <stdlib.h> #include <string.h> diff --git a/src/basic/calendarspec.c b/src/basic/calendarspec.c index 8f60561ede..2c670a1ac6 100644 --- a/src/basic/calendarspec.c +++ b/src/basic/calendarspec.c @@ -19,13 +19,19 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <alloca.h> +#include <errno.h> +#include <stddef.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> +#include <time.h> #include "alloc-util.h" #include "calendarspec.h" #include "fileio.h" #include "parse-util.h" +#include "macro.h" #include "string-util.h" #define BITS_WEEKDAYS 127 diff --git a/src/basic/calendarspec.h b/src/basic/calendarspec.h index 75b699682a..4e3aa9e1d8 100644 --- a/src/basic/calendarspec.h +++ b/src/basic/calendarspec.h @@ -26,6 +26,7 @@ #include <stdbool.h> +#include "time-util.h" #include "util.h" typedef struct CalendarComponent { diff --git a/src/basic/cap-list.c b/src/basic/cap-list.c index f0974900cd..aac812dc52 100644 --- a/src/basic/cap-list.c +++ b/src/basic/cap-list.c @@ -19,11 +19,13 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> #include <string.h> #include "cap-list.h" #include "missing.h" #include "parse-util.h" +#include "macro.h" #include "util.h" static const struct capability_name* lookup_capability(register const char *str, register unsigned int len); diff --git a/src/basic/capability-util.c b/src/basic/capability-util.c index 0eb5c03d65..fef722b6f2 100644 --- a/src/basic/capability-util.c +++ b/src/basic/capability-util.c @@ -22,6 +22,7 @@ #include <errno.h> #include <grp.h> #include <stdio.h> +#include <stdlib.h> #include <sys/capability.h> #include <sys/prctl.h> #include <unistd.h> diff --git a/src/basic/capability-util.h b/src/basic/capability-util.h index 4eb5c2a835..6bbf7318fd 100644 --- a/src/basic/capability-util.h +++ b/src/basic/capability-util.h @@ -22,8 +22,11 @@ ***/ #include <stdbool.h> +#include <stdint.h> #include <sys/capability.h> +#include <sys/types.h> +#include "macro.h" #include "util.h" unsigned long cap_last_cap(void); diff --git a/src/basic/cgroup-util.c b/src/basic/cgroup-util.c index f7fc2c2c97..7c580caa43 100644 --- a/src/basic/cgroup-util.c +++ b/src/basic/cgroup-util.c @@ -22,10 +22,13 @@ #include <dirent.h> #include <errno.h> #include <ftw.h> +#include <limits.h> #include <signal.h> +#include <stddef.h> #include <stdlib.h> #include <string.h> #include <sys/stat.h> +#include <sys/statfs.h> #include <sys/types.h> #include <unistd.h> @@ -46,12 +49,14 @@ #include "process-util.h" #include "set.h" #include "special.h" +#include "def.h" +#include "log.h" +#include "missing.h" #include "stat-util.h" #include "string-table.h" #include "string-util.h" #include "unit-name.h" #include "user-util.h" -#include "util.h" int cg_enumerate_processes(const char *controller, const char *path, FILE **_f) { _cleanup_free_ char *fs = NULL; diff --git a/src/basic/cgroup-util.h b/src/basic/cgroup-util.h index a80ee60bd3..b506995794 100644 --- a/src/basic/cgroup-util.h +++ b/src/basic/cgroup-util.h @@ -22,11 +22,15 @@ ***/ #include <dirent.h> +#include <stdbool.h> +#include <stdint.h> #include <stdio.h> #include <sys/types.h> #include "def.h" #include "set.h" +#include "hashmap.h" +#include "macro.h" /* An enum of well known cgroup controllers */ typedef enum CGroupController { diff --git a/src/basic/chattr-util.c b/src/basic/chattr-util.c index d49ca0537a..438fc63c5c 100644 --- a/src/basic/chattr-util.c +++ b/src/basic/chattr-util.c @@ -19,13 +19,15 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> +#include <fcntl.h> #include <sys/ioctl.h> #include <sys/stat.h> #include <linux/fs.h> #include "chattr-util.h" #include "fd-util.h" -#include "util.h" +#include "macro.h" int chattr_fd(int fd, unsigned value, unsigned mask) { unsigned old_attr, new_attr; diff --git a/src/basic/clock-util.c b/src/basic/clock-util.c index 00ee4c2796..00f549c023 100644 --- a/src/basic/clock-util.c +++ b/src/basic/clock-util.c @@ -21,6 +21,9 @@ #include <errno.h> #include <fcntl.h> +#include <limits.h> +#include <stdbool.h> +#include <time.h> #include <linux/rtc.h> #include <stdio.h> #include <sys/ioctl.h> @@ -30,7 +33,6 @@ #include "fd-util.h" #include "macro.h" #include "string-util.h" -#include "util.h" int clock_get_hwclock(struct tm *tm) { _cleanup_close_ int fd = -1; diff --git a/src/basic/conf-files.c b/src/basic/conf-files.c index be9972ffff..75dad228e3 100644 --- a/src/basic/conf-files.c +++ b/src/basic/conf-files.c @@ -21,6 +21,7 @@ #include <dirent.h> #include <errno.h> +#include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> diff --git a/src/basic/copy.c b/src/basic/copy.c index a187ae08fe..c335959b74 100644 --- a/src/basic/copy.c +++ b/src/basic/copy.c @@ -19,8 +19,18 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <dirent.h> +#include <errno.h> +#include <fcntl.h> +#include <stddef.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> #include <sys/sendfile.h> +#include <sys/stat.h> #include <sys/xattr.h> +#include <time.h> +#include <unistd.h> #include "alloc-util.h" #include "btrfs-util.h" @@ -31,10 +41,11 @@ #include "fileio.h" #include "fs-util.h" #include "io-util.h" +#include "macro.h" +#include "time-util.h" #include "string-util.h" #include "strv.h" #include "umask-util.h" -#include "util.h" #include "xattr-util.h" #define COPY_BUFFER_SIZE (16*1024) diff --git a/src/basic/copy.h b/src/basic/copy.h index ba0890b442..b3fc2bb709 100644 --- a/src/basic/copy.h +++ b/src/basic/copy.h @@ -23,6 +23,7 @@ #include <inttypes.h> #include <stdbool.h> +#include <stdint.h> #include <sys/types.h> int copy_file_fd(const char *from, int to, bool try_reflink); diff --git a/src/basic/cpu-set-util.c b/src/basic/cpu-set-util.c index e2ec4ca83f..51c0693954 100644 --- a/src/basic/cpu-set-util.c +++ b/src/basic/cpu-set-util.c @@ -20,12 +20,17 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> +#include <stddef.h> +#include <syslog.h> + #include "alloc-util.h" #include "cpu-set-util.h" #include "extract-word.h" #include "parse-util.h" +#include "log.h" +#include "macro.h" #include "string-util.h" -#include "util.h" cpu_set_t* cpu_set_malloc(unsigned *ncpus) { cpu_set_t *c; diff --git a/src/basic/device-nodes.c b/src/basic/device-nodes.c index 9d5af72d27..ec58cfdd4c 100644 --- a/src/basic/device-nodes.c +++ b/src/basic/device-nodes.c @@ -19,7 +19,9 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> #include <stdio.h> +#include <string.h> #include "device-nodes.h" #include "utf8.h" diff --git a/src/basic/device-nodes.h b/src/basic/device-nodes.h index 7db81f3d52..9669c86970 100644 --- a/src/basic/device-nodes.h +++ b/src/basic/device-nodes.h @@ -21,6 +21,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <stddef.h> #include <sys/types.h> int encode_devnode_name(const char *str, char *str_enc, size_t len); diff --git a/src/basic/dirent-util.c b/src/basic/dirent-util.c index c433d5844a..4ef5aba5a8 100644 --- a/src/basic/dirent-util.c +++ b/src/basic/dirent-util.c @@ -21,10 +21,9 @@ #include <fcntl.h> #include <sys/stat.h> -#include <sys/types.h> -#include <unistd.h> #include "dirent-util.h" +#include "path-util.h" #include "string-util.h" int dirent_ensure_type(DIR *d, struct dirent *de) { diff --git a/src/basic/dirent-util.h b/src/basic/dirent-util.h index 5866a755f4..58273bb988 100644 --- a/src/basic/dirent-util.h +++ b/src/basic/dirent-util.h @@ -22,8 +22,11 @@ ***/ #include <dirent.h> +#include <errno.h> +#include <stdbool.h> #include "path-util.h" +#include "macro.h" int dirent_ensure_type(DIR *d, struct dirent *de); diff --git a/src/basic/env-util.c b/src/basic/env-util.c index 441169db31..fe8c825f36 100644 --- a/src/basic/env-util.c +++ b/src/basic/env-util.c @@ -19,17 +19,21 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> #include <limits.h> +#include <stdarg.h> +#include <stdlib.h> +#include <string.h> #include <unistd.h> #include "alloc-util.h" -#include "def.h" #include "env-util.h" #include "parse-util.h" +#include "extract-word.h" +#include "macro.h" #include "string-util.h" #include "strv.h" #include "utf8.h" -#include "util.h" #define VALID_CHARS_ENV_NAME \ DIGITS LETTERS \ diff --git a/src/basic/env-util.h b/src/basic/env-util.h index 5efffa3dc7..3b83a63a78 100644 --- a/src/basic/env-util.h +++ b/src/basic/env-util.h @@ -22,6 +22,7 @@ ***/ #include <stdbool.h> +#include <stddef.h> #include "macro.h" diff --git a/src/basic/errno-list.c b/src/basic/errno-list.c index 22869e4136..0a66902ac9 100644 --- a/src/basic/errno-list.c +++ b/src/basic/errno-list.c @@ -22,7 +22,7 @@ #include <string.h> #include "errno-list.h" -#include "util.h" +#include "macro.h" static const struct errno_name* lookup_errno(register const char *str, register unsigned int len); diff --git a/src/basic/escape.c b/src/basic/escape.c index 42a84c9317..ab282efa3c 100644 --- a/src/basic/escape.c +++ b/src/basic/escape.c @@ -19,12 +19,15 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> +#include <stdlib.h> +#include <string.h> + #include "alloc-util.h" #include "escape.h" #include "hexdecoct.h" -#include "string-util.h" +#include "macro.h" #include "utf8.h" -#include "util.h" size_t cescape_char(char c, char *buf) { char * buf_old = buf; diff --git a/src/basic/escape.h b/src/basic/escape.h index 52ebf11c4a..c710f01743 100644 --- a/src/basic/escape.h +++ b/src/basic/escape.h @@ -22,8 +22,12 @@ ***/ #include <inttypes.h> +#include <stddef.h> +#include <stdint.h> #include <sys/types.h> +#include "string-util.h" + /* What characters are special in the shell? */ /* must be escaped outside and inside double-quotes */ #define SHELL_NEED_ESCAPE "\"\\`$" diff --git a/src/basic/ether-addr-util.c b/src/basic/ether-addr-util.c index 2bf3bfec1d..bc54f8f5f4 100644 --- a/src/basic/ether-addr-util.c +++ b/src/basic/ether-addr-util.c @@ -19,7 +19,9 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <net/ethernet.h> #include <stdio.h> +#include <sys/types.h> #include "ether-addr-util.h" #include "macro.h" diff --git a/src/basic/exit-status.h b/src/basic/exit-status.h index 7259cd1d18..850f58fd98 100644 --- a/src/basic/exit-status.h +++ b/src/basic/exit-status.h @@ -24,6 +24,8 @@ #include <stdbool.h> #include "set.h" +#include "hashmap.h" +#include "macro.h" typedef enum ExitStatus { /* EXIT_SUCCESS defined by libc */ diff --git a/src/basic/extract-word.c b/src/basic/extract-word.c index fd495692fa..7cc2a1de13 100644 --- a/src/basic/extract-word.c +++ b/src/basic/extract-word.c @@ -19,12 +19,22 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> +#include <stdarg.h> +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> +#include <syslog.h> + #include "alloc-util.h" #include "escape.h" #include "extract-word.h" +#include "log.h" +#include "macro.h" #include "string-util.h" #include "utf8.h" -#include "util.h" int extract_first_word(const char **p, char **ret, const char *separators, ExtractFlags flags) { _cleanup_free_ char *s = NULL; diff --git a/src/basic/fd-util.c b/src/basic/fd-util.c index d1b1db3a4d..678ac3b195 100644 --- a/src/basic/fd-util.c +++ b/src/basic/fd-util.c @@ -19,10 +19,19 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "dirent-util.h" +#include <errno.h> +#include <fcntl.h> +#include <sys/resource.h> +#include <sys/socket.h> +#include <sys/stat.h> +#include <unistd.h> + #include "fd-util.h" #include "parse-util.h" #include "socket-util.h" +#include "macro.h" +#include "missing.h" +#include "path-util.h" #include "util.h" int close_nointr(int fd) { diff --git a/src/basic/fdset.c b/src/basic/fdset.c index e5452f3bb0..654ec5a639 100644 --- a/src/basic/fdset.c +++ b/src/basic/fdset.c @@ -19,19 +19,21 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <alloca.h> #include <dirent.h> #include <errno.h> #include <fcntl.h> +#include <stddef.h> #include "sd-daemon.h" -#include "dirent-util.h" #include "fd-util.h" #include "fdset.h" #include "macro.h" #include "parse-util.h" #include "set.h" -#include "util.h" +#include "log.h" +#include "path-util.h" #define MAKE_SET(s) ((Set*) s) #define MAKE_FDSET(s) ((FDSet*) s) diff --git a/src/basic/fdset.h b/src/basic/fdset.h index 70d8acbcff..58a5b45f28 100644 --- a/src/basic/fdset.h +++ b/src/basic/fdset.h @@ -21,7 +21,11 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <stdbool.h> + #include "set.h" +#include "hashmap.h" +#include "macro.h" typedef struct FDSet FDSet; diff --git a/src/basic/fileio-label.c b/src/basic/fileio-label.c index 0405822ce0..52a1515cd7 100644 --- a/src/basic/fileio-label.c +++ b/src/basic/fileio-label.c @@ -20,9 +20,11 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <sys/stat.h> + #include "fileio-label.h" #include "selinux-util.h" -#include "util.h" +#include "fileio.h" int write_string_file_atomic_label(const char *fn, const char *line) { int r; diff --git a/src/basic/fileio.c b/src/basic/fileio.c index 10aacdc56d..684ce3d58f 100644 --- a/src/basic/fileio.c +++ b/src/basic/fileio.c @@ -19,6 +19,15 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> +#include <fcntl.h> +#include <limits.h> +#include <stdarg.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> +#include <sys/stat.h> +#include <sys/types.h> #include <unistd.h> #include "alloc-util.h" @@ -31,12 +40,14 @@ #include "parse-util.h" #include "path-util.h" #include "random-util.h" +#include "log.h" +#include "macro.h" +#include "time-util.h" #include "stdio-util.h" #include "string-util.h" #include "strv.h" #include "umask-util.h" #include "utf8.h" -#include "util.h" int write_string_stream(FILE *f, const char *line, bool enforce_newline) { diff --git a/src/basic/fs-util.c b/src/basic/fs-util.c index 2b6189ad90..cd7abee989 100644 --- a/src/basic/fs-util.c +++ b/src/basic/fs-util.c @@ -19,6 +19,16 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <dirent.h> +#include <errno.h> +#include <stddef.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/stat.h> +#include <time.h> +#include <unistd.h> + #include "alloc-util.h" #include "dirent-util.h" #include "fd-util.h" @@ -27,6 +37,10 @@ #include "mkdir.h" #include "parse-util.h" #include "path-util.h" +#include "log.h" +#include "macro.h" +#include "missing.h" +#include "time-util.h" #include "string-util.h" #include "strv.h" #include "user-util.h" diff --git a/src/basic/fs-util.h b/src/basic/fs-util.h index 5fbb7bc4c3..67ed214b51 100644 --- a/src/basic/fs-util.h +++ b/src/basic/fs-util.h @@ -23,6 +23,8 @@ #include <fcntl.h> #include <limits.h> +#include <stdbool.h> +#include <stdint.h> #include <sys/inotify.h> #include <sys/types.h> #include <unistd.h> diff --git a/src/basic/glob-util.c b/src/basic/glob-util.c index 0bfbcb1d37..a0be0efd40 100644 --- a/src/basic/glob-util.c +++ b/src/basic/glob-util.c @@ -19,12 +19,12 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> #include <glob.h> #include "glob-util.h" -#include "string-util.h" +#include "macro.h" #include "strv.h" -#include "util.h" int glob_exists(const char *path) { _cleanup_globfree_ glob_t g = {}; diff --git a/src/basic/glob-util.h b/src/basic/glob-util.h index 793adf4a6c..a0a5efe5b6 100644 --- a/src/basic/glob-util.h +++ b/src/basic/glob-util.h @@ -21,6 +21,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <stdbool.h> #include <string.h> #include "macro.h" diff --git a/src/basic/gunicode.c b/src/basic/gunicode.c index d89a2f3ed9..542110503f 100644 --- a/src/basic/gunicode.c +++ b/src/basic/gunicode.c @@ -4,6 +4,8 @@ * Copyright 2000, 2005 Red Hat, Inc. */ +#include <stdlib.h> + #include "gunicode.h" #define unichar uint32_t diff --git a/src/basic/hashmap.c b/src/basic/hashmap.c index 6e501ef6ff..b3954e3223 100644 --- a/src/basic/hashmap.c +++ b/src/basic/hashmap.c @@ -21,8 +21,9 @@ ***/ #include <errno.h> -#include <pthread.h> +#include <stdint.h> #include <stdlib.h> +#include <string.h> #include "alloc-util.h" #include "hashmap.h" diff --git a/src/basic/hashmap.h b/src/basic/hashmap.h index ed6a092d82..708811124b 100644 --- a/src/basic/hashmap.h +++ b/src/basic/hashmap.h @@ -22,7 +22,9 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <limits.h> #include <stdbool.h> +#include <stddef.h> #include "macro.h" #include "siphash24.h" diff --git a/src/basic/hexdecoct.c b/src/basic/hexdecoct.c index 4eb566b15a..1e907de228 100644 --- a/src/basic/hexdecoct.c +++ b/src/basic/hexdecoct.c @@ -20,11 +20,13 @@ ***/ #include <ctype.h> -#include <inttypes.h> +#include <errno.h> +#include <stdint.h> +#include <stdlib.h> #include "alloc-util.h" #include "hexdecoct.h" -#include "util.h" +#include "macro.h" char octchar(int x) { return '0' + (x & 7); diff --git a/src/basic/hexdecoct.h b/src/basic/hexdecoct.h index 4aeb4c3bdc..d9eb54a8a1 100644 --- a/src/basic/hexdecoct.h +++ b/src/basic/hexdecoct.h @@ -22,6 +22,7 @@ ***/ #include <stdbool.h> +#include <stddef.h> #include <stdio.h> #include <sys/types.h> diff --git a/src/basic/hostname-util.c b/src/basic/hostname-util.c index c57a3cbd60..795afb6d00 100644 --- a/src/basic/hostname-util.c +++ b/src/basic/hostname-util.c @@ -19,14 +19,19 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include <ctype.h> +#include <bits/local_lim.h> +#include <errno.h> +#include <limits.h> +#include <stdio.h> +#include <string.h> #include <sys/utsname.h> +#include <unistd.h> #include "fd-util.h" #include "fileio.h" #include "hostname-util.h" +#include "macro.h" #include "string-util.h" -#include "util.h" bool hostname_is_set(void) { struct utsname u; diff --git a/src/basic/in-addr-util.c b/src/basic/in-addr-util.c index b75c39aac7..5143dddf8f 100644 --- a/src/basic/in-addr-util.c +++ b/src/basic/in-addr-util.c @@ -20,9 +20,15 @@ ***/ #include <arpa/inet.h> +#include <endian.h> +#include <errno.h> +#include <stdint.h> +#include <stdlib.h> #include "alloc-util.h" #include "in-addr-util.h" +#include "macro.h" +#include "util.h" int in_addr_is_null(int family, const union in_addr_union *u) { assert(u); diff --git a/src/basic/in-addr-util.h b/src/basic/in-addr-util.h index 58f55b3418..bcc116c783 100644 --- a/src/basic/in-addr-util.h +++ b/src/basic/in-addr-util.h @@ -22,6 +22,8 @@ ***/ #include <netinet/in.h> +#include <stddef.h> +#include <sys/socket.h> #include "macro.h" #include "util.h" diff --git a/src/basic/io-util.c b/src/basic/io-util.c index ac8f93ff57..e83e7cec72 100644 --- a/src/basic/io-util.c +++ b/src/basic/io-util.c @@ -19,10 +19,15 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> +#include <limits.h> #include <poll.h> +#include <stdio.h> +#include <time.h> #include <unistd.h> #include "io-util.h" +#include "time-util.h" int flush_fd(int fd) { struct pollfd pollfd = { diff --git a/src/basic/io-util.h b/src/basic/io-util.h index cd2aa75ad2..5f77a556c0 100644 --- a/src/basic/io-util.h +++ b/src/basic/io-util.h @@ -22,9 +22,12 @@ ***/ #include <stdbool.h> +#include <stddef.h> +#include <stdint.h> #include <sys/types.h> #include <sys/uio.h> +#include "macro.h" #include "time-util.h" int flush_fd(int fd); diff --git a/src/basic/json.c b/src/basic/json.c index 9d5dedb934..1523e9fb09 100644 --- a/src/basic/json.c +++ b/src/basic/json.c @@ -19,7 +19,10 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> #include <math.h> +#include <stdlib.h> +#include <string.h> #include <sys/types.h> #include "alloc-util.h" diff --git a/src/basic/json.h b/src/basic/json.h index 8a7d79cb17..df3f62f206 100644 --- a/src/basic/json.h +++ b/src/basic/json.h @@ -22,7 +22,10 @@ ***/ #include <stdbool.h> +#include <stddef.h> +#include <stdint.h> +#include "macro.h" #include "util.h" enum { diff --git a/src/basic/label.c b/src/basic/label.c index f33502f90f..70e6ee20bf 100644 --- a/src/basic/label.c +++ b/src/basic/label.c @@ -19,10 +19,14 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> +#include <sys/stat.h> +#include <unistd.h> + #include "label.h" #include "selinux-util.h" #include "smack-util.h" -#include "util.h" +#include "macro.h" int label_fix(const char *path, bool ignore_enoent, bool ignore_erofs) { int r, q; diff --git a/src/basic/locale-util.c b/src/basic/locale-util.c index b87fd7670b..708da0d304 100644 --- a/src/basic/locale-util.c +++ b/src/basic/locale-util.c @@ -19,20 +19,29 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <dirent.h> +#include <errno.h> +#include <fcntl.h> #include <langinfo.h> +#include <libintl.h> #include <locale.h> +#include <stddef.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> #include <sys/mman.h> +#include <sys/stat.h> #include "dirent-util.h" #include "fd-util.h" #include "locale-util.h" #include "path-util.h" #include "set.h" +#include "hashmap.h" #include "string-table.h" #include "string-util.h" #include "strv.h" #include "utf8.h" -#include "util.h" static int add_locales_from_archive(Set *locales) { /* Stolen from glibc... */ diff --git a/src/basic/lockfile-util.c b/src/basic/lockfile-util.c index 0bdbae480b..704ae6cc52 100644 --- a/src/basic/lockfile-util.c +++ b/src/basic/lockfile-util.c @@ -20,20 +20,18 @@ ***/ #include <errno.h> -#include <limits.h> -#include <stdbool.h> +#include <fcntl.h> #include <stdio.h> -#include <stdlib.h> #include <string.h> #include <sys/file.h> +#include <sys/stat.h> #include "alloc-util.h" #include "fd-util.h" -#include "fileio.h" #include "fs-util.h" #include "lockfile-util.h" #include "path-util.h" -#include "util.h" +#include "macro.h" int make_lock_file(const char *p, int operation, LockFile *ret) { _cleanup_close_ int fd = -1; diff --git a/src/basic/lockfile-util.h b/src/basic/lockfile-util.h index 38d47094bd..3c514c9e62 100644 --- a/src/basic/lockfile-util.h +++ b/src/basic/lockfile-util.h @@ -21,6 +21,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <stddef.h> + #include "macro.h" #include "missing.h" diff --git a/src/basic/log.c b/src/basic/log.c index fe29cacd9e..829f85a5d8 100644 --- a/src/basic/log.c +++ b/src/basic/log.c @@ -21,12 +21,18 @@ #include <errno.h> #include <fcntl.h> -#include <printf.h> +#include <inttypes.h> +#include <limits.h> #include <stdarg.h> #include <stddef.h> #include <stdio.h> +#include <string.h> +#include <sys/signalfd.h> #include <sys/socket.h> +#include <sys/time.h> +#include <sys/uio.h> #include <sys/un.h> +#include <time.h> #include <unistd.h> #include "sd-messages.h" @@ -43,6 +49,7 @@ #include "process-util.h" #include "signal-util.h" #include "socket-util.h" +#include "time-util.h" #include "stdio-util.h" #include "string-table.h" #include "string-util.h" diff --git a/src/basic/login-util.c b/src/basic/login-util.c index 41cef14e73..4e08fe3895 100644 --- a/src/basic/login-util.c +++ b/src/basic/login-util.c @@ -19,7 +19,8 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include "def.h" +#include <string.h> + #include "login-util.h" #include "string-util.h" diff --git a/src/basic/memfd-util.c b/src/basic/memfd-util.c index 92630f6b25..a9b2151195 100644 --- a/src/basic/memfd-util.c +++ b/src/basic/memfd-util.c @@ -19,7 +19,10 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> #include <fcntl.h> +#include <sys/stat.h> +#include <unistd.h> #ifdef HAVE_LINUX_MEMFD_H #include <linux/memfd.h> #endif @@ -31,9 +34,9 @@ #include "fd-util.h" #include "memfd-util.h" #include "missing.h" +#include "macro.h" #include "string-util.h" #include "utf8.h" -#include "util.h" int memfd_new(const char *name) { _cleanup_free_ char *g = NULL; diff --git a/src/basic/memfd-util.h b/src/basic/memfd-util.h index 3e4de008a4..2a89361c4c 100644 --- a/src/basic/memfd-util.h +++ b/src/basic/memfd-util.h @@ -22,6 +22,8 @@ ***/ #include <inttypes.h> +#include <stddef.h> +#include <stdint.h> #include <sys/types.h> int memfd_new(const char *name); diff --git a/src/basic/mempool.c b/src/basic/mempool.c index 9ee6e6a76d..1822d3956f 100644 --- a/src/basic/mempool.c +++ b/src/basic/mempool.c @@ -20,6 +20,9 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <stdint.h> +#include <stdlib.h> + #include "macro.h" #include "mempool.h" #include "util.h" diff --git a/src/basic/mkdir-label.c b/src/basic/mkdir-label.c index c241ef6064..c9e17f7680 100644 --- a/src/basic/mkdir-label.c +++ b/src/basic/mkdir-label.c @@ -21,6 +21,7 @@ ***/ #include <stdio.h> +#include <sys/types.h> #include <unistd.h> #include "label.h" diff --git a/src/basic/mkdir.c b/src/basic/mkdir.c index 5d7fb9a12d..4b809541b1 100644 --- a/src/basic/mkdir.c +++ b/src/basic/mkdir.c @@ -20,14 +20,16 @@ ***/ #include <errno.h> +#include <stdbool.h> #include <string.h> +#include <sys/stat.h> #include "fs-util.h" #include "mkdir.h" #include "path-util.h" +#include "macro.h" #include "stat-util.h" #include "user-util.h" -#include "util.h" int mkdir_safe_internal(const char *path, mode_t mode, uid_t uid, gid_t gid, mkdir_func_t _mkdir) { struct stat st; diff --git a/src/basic/mount-util.c b/src/basic/mount-util.c index 29997b1ce7..aaac2d47bd 100644 --- a/src/basic/mount-util.c +++ b/src/basic/mount-util.c @@ -19,9 +19,13 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> +#include <stdlib.h> #include <string.h> #include <sys/mount.h> +#include <sys/stat.h> #include <sys/statvfs.h> +#include <unistd.h> #include "alloc-util.h" #include "escape.h" @@ -31,9 +35,9 @@ #include "parse-util.h" #include "path-util.h" #include "set.h" +#include "hashmap.h" #include "stdio-util.h" #include "string-util.h" -#include "util.h" static int fd_fdinfo_mnt_id(int fd, const char *filename, int flags, int *mnt_id) { char path[strlen("/proc/self/fdinfo/") + DECIMAL_STR_MAX(int)]; diff --git a/src/basic/mount-util.h b/src/basic/mount-util.h index 48954c2d67..3be75e6614 100644 --- a/src/basic/mount-util.h +++ b/src/basic/mount-util.h @@ -24,10 +24,12 @@ #include <fcntl.h> #include <mntent.h> #include <stdbool.h> +#include <stdio.h> #include <sys/stat.h> #include <sys/types.h> #include "missing.h" +#include "macro.h" int fd_is_mount_point(int fd, const char *filename, int flags); int path_is_mount_point(const char *path, int flags); diff --git a/src/basic/parse-util.c b/src/basic/parse-util.c index 3ae99d9334..3d8123ca0d 100644 --- a/src/basic/parse-util.c +++ b/src/basic/parse-util.c @@ -19,11 +19,19 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> +#include <inttypes.h> +#include <locale.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <xlocale.h> + #include "alloc-util.h" #include "extract-word.h" #include "parse-util.h" +#include "macro.h" #include "string-util.h" -#include "util.h" int parse_boolean(const char *v) { assert(v); diff --git a/src/basic/parse-util.h b/src/basic/parse-util.h index 125de53d7a..af439cfaa7 100644 --- a/src/basic/parse-util.h +++ b/src/basic/parse-util.h @@ -22,6 +22,9 @@ ***/ #include <inttypes.h> +#include <limits.h> +#include <stddef.h> +#include <stdint.h> #include <sys/types.h> #include "macro.h" diff --git a/src/basic/path-util.c b/src/basic/path-util.c index ec90c432a4..95b1052aeb 100644 --- a/src/basic/path-util.c +++ b/src/basic/path-util.c @@ -20,11 +20,11 @@ ***/ #include <errno.h> -#include <fcntl.h> +#include <limits.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/statvfs.h> +#include <sys/stat.h> #include <unistd.h> /* When we include libgen.h because we need dirname() we immediately @@ -34,18 +34,16 @@ #undef basename #include "alloc-util.h" -#include "fd-util.h" -#include "fileio.h" #include "fs-util.h" #include "log.h" #include "macro.h" #include "missing.h" -#include "parse-util.h" #include "path-util.h" +#include "extract-word.h" +#include "time-util.h" #include "stat-util.h" #include "string-util.h" #include "strv.h" -#include "util.h" bool path_is_absolute(const char *p) { return p[0] == '/'; diff --git a/src/basic/path-util.h b/src/basic/path-util.h index 989e0f9004..84472d38c7 100644 --- a/src/basic/path-util.h +++ b/src/basic/path-util.h @@ -21,7 +21,9 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <alloca.h> #include <stdbool.h> +#include <stddef.h> #include "macro.h" #include "time-util.h" diff --git a/src/basic/prioq.c b/src/basic/prioq.c index 7590698911..7d420d8a7b 100644 --- a/src/basic/prioq.c +++ b/src/basic/prioq.c @@ -29,9 +29,12 @@ * The underlying algorithm used in this implementation is a Heap. */ +#include <errno.h> +#include <stdlib.h> + #include "alloc-util.h" #include "prioq.h" -#include "util.h" +#include "hashmap.h" struct prioq_item { void *data; diff --git a/src/basic/prioq.h b/src/basic/prioq.h index 1c044b135c..6a2451387c 100644 --- a/src/basic/prioq.h +++ b/src/basic/prioq.h @@ -21,7 +21,10 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <stdbool.h> + #include "hashmap.h" +#include "macro.h" typedef struct Prioq Prioq; diff --git a/src/basic/proc-cmdline.c b/src/basic/proc-cmdline.c index 4464573c5b..4e8eba10ab 100644 --- a/src/basic/proc-cmdline.c +++ b/src/basic/proc-cmdline.c @@ -19,6 +19,10 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <stdbool.h> +#include <stddef.h> +#include <string.h> + #include "alloc-util.h" #include "extract-word.h" #include "fileio.h" diff --git a/src/basic/process-util.c b/src/basic/process-util.c index 7631928d5f..1d60811cbf 100644 --- a/src/basic/process-util.c +++ b/src/basic/process-util.c @@ -17,18 +17,21 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include <assert.h> #include <ctype.h> #include <errno.h> +#include <limits.h> +#include <linux/oom.h> #include <sched.h> #include <signal.h> #include <stdbool.h> #include <stdio.h> +#include <stdlib.h> #include <string.h> #include <sys/personality.h> #include <sys/prctl.h> #include <sys/types.h> #include <sys/wait.h> +#include <syslog.h> #include <unistd.h> #include "alloc-util.h" @@ -40,6 +43,8 @@ #include "log.h" #include "process-util.h" #include "signal-util.h" +#include "macro.h" +#include "missing.h" #include "string-table.h" #include "string-util.h" #include "user-util.h" diff --git a/src/basic/process-util.h b/src/basic/process-util.h index fdc7e1bdef..f4c4437624 100644 --- a/src/basic/process-util.h +++ b/src/basic/process-util.h @@ -22,6 +22,7 @@ #include <alloca.h> #include <signal.h> #include <stdbool.h> +#include <stddef.h> #include <stdio.h> #include <string.h> #include <sys/types.h> diff --git a/src/basic/random-util.c b/src/basic/random-util.c index 2f5c16e2af..e1543da5a3 100644 --- a/src/basic/random-util.c +++ b/src/basic/random-util.c @@ -17,23 +17,24 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <elf.h> #include <errno.h> #include <fcntl.h> +#include <stdbool.h> +#include <stdlib.h> +#include <sys/time.h> #include <linux/random.h> #include <stdint.h> + #ifdef HAVE_SYS_AUXV_H #include <sys/auxv.h> #endif -#include <sys/stat.h> -#include <sys/types.h> -#include <time.h> #include "fd-util.h" #include "io-util.h" #include "missing.h" #include "random-util.h" #include "time-util.h" -#include "util.h" int dev_urandom(void *p, size_t n) { static int have_syscall = -1; diff --git a/src/basic/random-util.h b/src/basic/random-util.h index f7862c8c8b..3cee4c5014 100644 --- a/src/basic/random-util.h +++ b/src/basic/random-util.h @@ -19,6 +19,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <stddef.h> #include <stdint.h> int dev_urandom(void *p, size_t n); diff --git a/src/basic/ratelimit.c b/src/basic/ratelimit.c index 81fc9c19ff..ee0f8176b9 100644 --- a/src/basic/ratelimit.c +++ b/src/basic/ratelimit.c @@ -20,7 +20,10 @@ ***/ +#include <sys/time.h> + #include "ratelimit.h" +#include "macro.h" /* Modelled after Linux' lib/ratelimit.c by Dave Young * <hidave.darkstar@gmail.com>, which is licensed GPLv2. */ diff --git a/src/basic/ratelimit.h b/src/basic/ratelimit.h index 58efca7df1..98c81f6b9e 100644 --- a/src/basic/ratelimit.h +++ b/src/basic/ratelimit.h @@ -21,6 +21,9 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <stdbool.h> + +#include "time-util.h" #include "util.h" typedef struct RateLimit { diff --git a/src/basic/replace-var.c b/src/basic/replace-var.c index bf757cbc48..8c3279b376 100644 --- a/src/basic/replace-var.c +++ b/src/basic/replace-var.c @@ -19,13 +19,15 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> +#include <stddef.h> +#include <stdlib.h> #include <string.h> #include "alloc-util.h" #include "macro.h" #include "replace-var.h" #include "string-util.h" -#include "util.h" /* * Generic infrastructure for replacing @FOO@ style variables in diff --git a/src/basic/rlimit-util.c b/src/basic/rlimit-util.c index 2627c813fc..2de965daa6 100644 --- a/src/basic/rlimit-util.c +++ b/src/basic/rlimit-util.c @@ -19,10 +19,13 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> +#include <sys/resource.h> + #include "missing.h" #include "rlimit-util.h" +#include "macro.h" #include "string-table.h" -#include "util.h" int setrlimit_closest(int resource, const struct rlimit *rlim) { struct rlimit highest, fixed; diff --git a/src/basic/rm-rf.c b/src/basic/rm-rf.c index 8ec7dd75ee..0408e22777 100644 --- a/src/basic/rm-rf.c +++ b/src/basic/rm-rf.c @@ -19,14 +19,24 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <dirent.h> +#include <errno.h> +#include <fcntl.h> +#include <stdbool.h> +#include <stddef.h> +#include <sys/stat.h> +#include <sys/statfs.h> +#include <unistd.h> + #include "btrfs-util.h" #include "fd-util.h" #include "mount-util.h" #include "path-util.h" #include "rm-rf.h" +#include "log.h" +#include "macro.h" #include "stat-util.h" #include "string-util.h" -#include "util.h" int rm_rf_children(int fd, RemoveFlags flags, struct stat *root_dev) { _cleanup_closedir_ DIR *d = NULL; diff --git a/src/basic/selinux-util.c b/src/basic/selinux-util.c index 7e4ae33efe..9be8e2c76f 100644 --- a/src/basic/selinux-util.c +++ b/src/basic/selinux-util.c @@ -21,7 +21,12 @@ #include <errno.h> #include <malloc.h> +#include <stddef.h> +#include <string.h> +#include <sys/stat.h> +#include <sys/time.h> #include <sys/un.h> +#include <syslog.h> #ifdef HAVE_SELINUX #include <selinux/context.h> @@ -32,7 +37,10 @@ #include "alloc-util.h" #include "path-util.h" #include "selinux-util.h" -#include "strv.h" +#include "log.h" +#include "macro.h" +#include "time-util.h" +#include "util.h" #ifdef HAVE_SELINUX DEFINE_TRIVIAL_CLEANUP_FUNC(security_context_t, freecon); diff --git a/src/basic/selinux-util.h b/src/basic/selinux-util.h index 95a2fcdbca..0111f4c858 100644 --- a/src/basic/selinux-util.h +++ b/src/basic/selinux-util.h @@ -23,6 +23,7 @@ #include <stdbool.h> #include <sys/socket.h> +#include <sys/types.h> #include "macro.h" diff --git a/src/basic/sigbus.c b/src/basic/sigbus.c index c535c89d52..fe2e2d1a28 100644 --- a/src/basic/sigbus.c +++ b/src/basic/sigbus.c @@ -19,7 +19,9 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> #include <signal.h> +#include <stddef.h> #include <sys/mman.h> #include "macro.h" diff --git a/src/basic/signal-util.c b/src/basic/signal-util.c index 8038bc891d..fd9258dfca 100644 --- a/src/basic/signal-util.c +++ b/src/basic/signal-util.c @@ -19,11 +19,15 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> +#include <stdarg.h> +#include <stdio.h> + #include "parse-util.h" #include "signal-util.h" +#include "macro.h" #include "string-table.h" #include "string-util.h" -#include "util.h" int reset_all_signal_handlers(void) { static const struct sigaction sa = { diff --git a/src/basic/siphash24.c b/src/basic/siphash24.c index 10fc56da69..65667b9859 100644 --- a/src/basic/siphash24.c +++ b/src/basic/siphash24.c @@ -18,9 +18,8 @@ */ #include "siphash24.h" -#include "sparse-endian.h" +#include "macro.h" #include "unaligned.h" -#include "util.h" static inline uint64_t rotate_left(uint64_t x, uint8_t b) { assert(b < 64); diff --git a/src/basic/siphash24.h b/src/basic/siphash24.h index ba4f7d01b6..3f7e20362b 100644 --- a/src/basic/siphash24.h +++ b/src/basic/siphash24.h @@ -1,6 +1,8 @@ #pragma once #include <inttypes.h> +#include <stddef.h> +#include <stdint.h> #include <sys/types.h> struct siphash { diff --git a/src/basic/smack-util.c b/src/basic/smack-util.c index fcc046098d..e8030c92f3 100644 --- a/src/basic/smack-util.c +++ b/src/basic/smack-util.c @@ -21,15 +21,20 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> +#include <string.h> +#include <sys/stat.h> #include <sys/xattr.h> +#include <unistd.h> #include "alloc-util.h" #include "fileio.h" #include "path-util.h" #include "process-util.h" #include "smack-util.h" +#include "log.h" +#include "macro.h" #include "string-table.h" -#include "util.h" #include "xattr-util.h" #ifdef HAVE_SMACK diff --git a/src/basic/smack-util.h b/src/basic/smack-util.h index e756dc8c28..1d85b52a33 100644 --- a/src/basic/smack-util.h +++ b/src/basic/smack-util.h @@ -24,6 +24,7 @@ ***/ #include <stdbool.h> +#include <sys/types.h> #include "macro.h" diff --git a/src/basic/socket-label.c b/src/basic/socket-label.c index e5d4efc719..2dc6c76752 100644 --- a/src/basic/socket-label.c +++ b/src/basic/socket-label.c @@ -20,9 +20,13 @@ ***/ #include <errno.h> +#include <netinet/in.h> +#include <stdbool.h> #include <stddef.h> #include <string.h> +#include <sys/socket.h> #include <sys/stat.h> +#include <sys/un.h> #include <unistd.h> #include "alloc-util.h" @@ -32,7 +36,7 @@ #include "mkdir.h" #include "selinux-util.h" #include "socket-util.h" -#include "util.h" +#include "log.h" int socket_address_listen( const SocketAddress *a, diff --git a/src/basic/socket-util.c b/src/basic/socket-util.c index 1acab1ef95..240fb60212 100644 --- a/src/basic/socket-util.c +++ b/src/basic/socket-util.c @@ -21,13 +21,15 @@ #include <arpa/inet.h> #include <errno.h> +#include <limits.h> #include <net/if.h> #include <netdb.h> #include <netinet/ip.h> #include <stddef.h> +#include <stdint.h> #include <stdio.h> +#include <stdlib.h> #include <string.h> -#include <sys/types.h> #include <unistd.h> #include "alloc-util.h" @@ -39,6 +41,7 @@ #include "parse-util.h" #include "path-util.h" #include "socket-util.h" +#include "log.h" #include "string-table.h" #include "string-util.h" #include "user-util.h" diff --git a/src/basic/socket-util.h b/src/basic/socket-util.h index 129ffa811c..f9c90e0e73 100644 --- a/src/basic/socket-util.h +++ b/src/basic/socket-util.h @@ -23,7 +23,10 @@ #include <netinet/ether.h> #include <netinet/in.h> +#include <stdbool.h> +#include <stddef.h> #include <sys/socket.h> +#include <sys/types.h> #include <sys/un.h> #include <linux/netlink.h> #include <linux/if_packet.h> diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c index 3bc66b3be7..21a8fb77a1 100644 --- a/src/basic/stat-util.c +++ b/src/basic/stat-util.c @@ -19,7 +19,11 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <dirent.h> +#include <errno.h> #include <fcntl.h> +#include <sys/stat.h> +#include <sys/types.h> #include <linux/magic.h> #include <sys/statvfs.h> #include <unistd.h> diff --git a/src/basic/stat-util.h b/src/basic/stat-util.h index fb92464274..8e031e6155 100644 --- a/src/basic/stat-util.h +++ b/src/basic/stat-util.h @@ -22,7 +22,9 @@ ***/ #include <stdbool.h> +#include <stddef.h> #include <sys/stat.h> +#include <sys/statfs.h> #include <sys/types.h> #include <sys/vfs.h> diff --git a/src/basic/strbuf.c b/src/basic/strbuf.c index f4f702a05a..c9984bef08 100644 --- a/src/basic/strbuf.c +++ b/src/basic/strbuf.c @@ -19,12 +19,12 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> #include <stdlib.h> #include <string.h> #include "alloc-util.h" #include "strbuf.h" -#include "util.h" /* * Strbuf stores given strings in a single continuous allocated memory diff --git a/src/basic/strbuf.h b/src/basic/strbuf.h index fbc4e5f2a1..69565f7e2c 100644 --- a/src/basic/strbuf.h +++ b/src/basic/strbuf.h @@ -21,7 +21,9 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <stddef.h> #include <stdint.h> +#include <sys/types.h> struct strbuf { char *buf; diff --git a/src/basic/string-table.c b/src/basic/string-table.c index a860324fc9..07a6d785f8 100644 --- a/src/basic/string-table.c +++ b/src/basic/string-table.c @@ -19,6 +19,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include "string-util.h" #include "string-table.h" ssize_t string_table_lookup(const char * const *table, size_t len, const char *key) { diff --git a/src/basic/string-table.h b/src/basic/string-table.h index 51b6007214..2181a3a767 100644 --- a/src/basic/string-table.h +++ b/src/basic/string-table.h @@ -22,6 +22,7 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> #include <stddef.h> #include <stdio.h> #include <string.h> diff --git a/src/basic/string-util.c b/src/basic/string-util.c index 6006767daa..8178c7093f 100644 --- a/src/basic/string-util.c +++ b/src/basic/string-util.c @@ -19,8 +19,15 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> +#include <stdarg.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> + #include "alloc-util.h" #include "gunicode.h" +#include "macro.h" #include "string-util.h" #include "utf8.h" #include "util.h" diff --git a/src/basic/string-util.h b/src/basic/string-util.h index 54f9d3058c..b59b9b5a71 100644 --- a/src/basic/string-util.h +++ b/src/basic/string-util.h @@ -21,7 +21,9 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <alloca.h> #include <stdbool.h> +#include <stddef.h> #include <string.h> #include "macro.h" diff --git a/src/basic/strv.c b/src/basic/strv.c index 771781f9fc..0a3d15706f 100644 --- a/src/basic/strv.c +++ b/src/basic/strv.c @@ -20,12 +20,15 @@ ***/ #include <errno.h> +#include <fnmatch.h> #include <stdarg.h> +#include <stdio.h> #include <stdlib.h> #include <string.h> #include "alloc-util.h" #include "escape.h" +#include "extract-word.h" #include "string-util.h" #include "strv.h" #include "util.h" diff --git a/src/basic/strv.h b/src/basic/strv.h index e66794fc34..d0dd08baf3 100644 --- a/src/basic/strv.h +++ b/src/basic/strv.h @@ -24,8 +24,11 @@ #include <fnmatch.h> #include <stdarg.h> #include <stdbool.h> +#include <stddef.h> #include "extract-word.h" +#include "alloc-util.h" +#include "macro.h" #include "util.h" char *strv_find(char **l, const char *name) _pure_; diff --git a/src/basic/strxcpyx.c b/src/basic/strxcpyx.c index 088ba53c29..c454171de1 100644 --- a/src/basic/strxcpyx.c +++ b/src/basic/strxcpyx.c @@ -25,6 +25,7 @@ * Returns the * remaining size, and 0 if the string was truncated. */ +#include <stdarg.h> #include <stdio.h> #include <string.h> diff --git a/src/basic/strxcpyx.h b/src/basic/strxcpyx.h index ccc7e52f37..02e22e6294 100644 --- a/src/basic/strxcpyx.h +++ b/src/basic/strxcpyx.h @@ -22,6 +22,8 @@ ***/ +#include <stddef.h> + #include "macro.h" size_t strpcpy(char **dest, size_t size, const char *src); diff --git a/src/basic/syslog-util.c b/src/basic/syslog-util.c index 01577941a0..7dc2761b6f 100644 --- a/src/basic/syslog-util.c +++ b/src/basic/syslog-util.c @@ -19,10 +19,11 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <string.h> #include <syslog.h> -#include "assert.h" #include "hexdecoct.h" +#include "macro.h" #include "string-table.h" #include "syslog-util.h" diff --git a/src/basic/terminal-util.c b/src/basic/terminal-util.c index 3931b03bc2..68664a152f 100644 --- a/src/basic/terminal-util.c +++ b/src/basic/terminal-util.c @@ -17,18 +17,25 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include <assert.h> +#include <errno.h> #include <fcntl.h> +#include <limits.h> +#include <stdarg.h> +#include <stddef.h> +#include <stdlib.h> +#include <string.h> +#include <sys/inotify.h> +#include <sys/socket.h> +#include <sys/sysmacros.h> +#include <sys/time.h> #include <linux/kd.h> #include <linux/tiocl.h> #include <linux/vt.h> #include <poll.h> #include <signal.h> #include <sys/ioctl.h> -#include <sys/stat.h> #include <sys/types.h> #include <termios.h> -#include <time.h> #include <unistd.h> #include "alloc-util.h" @@ -37,9 +44,10 @@ #include "fs-util.h" #include "io-util.h" #include "parse-util.h" -#include "path-util.h" #include "process-util.h" #include "socket-util.h" +#include "log.h" +#include "macro.h" #include "stat-util.h" #include "string-util.h" #include "terminal-util.h" diff --git a/src/basic/terminal-util.h b/src/basic/terminal-util.h index b2c7a297ae..597a0060ad 100644 --- a/src/basic/terminal-util.h +++ b/src/basic/terminal-util.h @@ -22,6 +22,7 @@ #include <stdarg.h> #include <stdbool.h> #include <stdio.h> +#include <sys/types.h> #include "macro.h" #include "time-util.h" diff --git a/src/basic/time-util.c b/src/basic/time-util.c index b9da6991da..a9296d6ee6 100644 --- a/src/basic/time-util.c +++ b/src/basic/time-util.c @@ -19,9 +19,16 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> +#include <limits.h> +#include <stdlib.h> #include <string.h> +#include <sys/stat.h> +#include <sys/time.h> #include <sys/timerfd.h> #include <sys/timex.h> +#include <sys/types.h> +#include <unistd.h> #include "alloc-util.h" #include "fd-util.h" @@ -29,10 +36,11 @@ #include "fs-util.h" #include "parse-util.h" #include "path-util.h" +#include "log.h" +#include "macro.h" #include "string-util.h" #include "strv.h" #include "time-util.h" -#include "util.h" usec_t now(clockid_t clock_id) { struct timespec ts; diff --git a/src/basic/time-util.h b/src/basic/time-util.h index 0417c29cdd..7321e3c670 100644 --- a/src/basic/time-util.h +++ b/src/basic/time-util.h @@ -22,6 +22,9 @@ ***/ #include <inttypes.h> +#include <stdbool.h> +#include <stddef.h> +#include <stdint.h> #include <stdio.h> #include <time.h> diff --git a/src/basic/unit-name.c b/src/basic/unit-name.c index 9a55eacbfb..bdec97e54b 100644 --- a/src/basic/unit-name.c +++ b/src/basic/unit-name.c @@ -20,18 +20,20 @@ ***/ #include <errno.h> +#include <stddef.h> +#include <stdint.h> +#include <stdlib.h> #include <string.h> #include "alloc-util.h" #include "bus-label.h" -#include "def.h" #include "hexdecoct.h" #include "path-util.h" +#include "macro.h" #include "string-table.h" #include "string-util.h" #include "strv.h" #include "unit-name.h" -#include "util.h" #define VALID_CHARS \ DIGITS LETTERS \ diff --git a/src/basic/user-util.c b/src/basic/user-util.c index 397880b0b1..55c64abdd9 100644 --- a/src/basic/user-util.c +++ b/src/basic/user-util.c @@ -19,17 +19,27 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <alloca.h> +#include <errno.h> +#include <fcntl.h> #include <grp.h> #include <pwd.h> +#include <stddef.h> +#include <stdint.h> +#include <stdio.h> +#include <stdlib.h> +#include <string.h> +#include <sys/stat.h> +#include <unistd.h> #include "alloc-util.h" #include "fd-util.h" #include "macro.h" #include "parse-util.h" #include "path-util.h" +#include "formats-util.h" #include "string-util.h" #include "user-util.h" -#include "util.h" bool uid_is_valid(uid_t uid) { diff --git a/src/basic/utf8.c b/src/basic/utf8.c index b4063a4cec..124effd6df 100644 --- a/src/basic/utf8.c +++ b/src/basic/utf8.c @@ -44,15 +44,14 @@ */ #include <errno.h> -#include <inttypes.h> #include <stdbool.h> #include <stdlib.h> #include <string.h> #include "alloc-util.h" #include "hexdecoct.h" +#include "macro.h" #include "utf8.h" -#include "util.h" bool unichar_is_valid(uint32_t ch) { diff --git a/src/basic/utf8.h b/src/basic/utf8.h index e745649f06..16c4b5b55d 100644 --- a/src/basic/utf8.h +++ b/src/basic/utf8.h @@ -22,6 +22,8 @@ ***/ #include <stdbool.h> +#include <stddef.h> +#include <stdint.h> #include "macro.h" diff --git a/src/basic/util.c b/src/basic/util.c index 58617b354a..6d264e0007 100644 --- a/src/basic/util.c +++ b/src/basic/util.c @@ -19,91 +19,46 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ -#include <ctype.h> +#include <alloca.h> #include <dirent.h> #include <errno.h> #include <fcntl.h> -#include <grp.h> -#include <langinfo.h> -#include <libintl.h> -#include <limits.h> -#include <linux/magic.h> -#include <linux/oom.h> -#include <linux/sched.h> -#include <locale.h> -#include <poll.h> -#include <pwd.h> #include <sched.h> #include <signal.h> #include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/file.h> -#include <sys/ioctl.h> #include <sys/mman.h> -#include <sys/mount.h> -#include <sys/personality.h> #include <sys/prctl.h> -#include <sys/stat.h> -#include <sys/statvfs.h> -#include <sys/time.h> +#include <sys/statfs.h> +#include <sys/sysmacros.h> #include <sys/types.h> -#include <sys/utsname.h> -#include <sys/vfs.h> -#include <sys/wait.h> -#include <syslog.h> #include <unistd.h> -/* When we include libgen.h because we need dirname() we immediately - * undefine basename() since libgen.h defines it as a macro to the - * POSIX version which is really broken. We prefer GNU basename(). */ -#include <libgen.h> -#undef basename - -#ifdef HAVE_SYS_AUXV_H -#include <sys/auxv.h> -#endif - -/* We include linux/fs.h as last of the system headers, as it - * otherwise conflicts with sys/mount.h. Yay, Linux is great! */ -#include <linux/fs.h> - #include "alloc-util.h" #include "build.h" #include "def.h" -#include "device-nodes.h" #include "dirent-util.h" -#include "env-util.h" -#include "escape.h" -#include "exit-status.h" #include "fd-util.h" #include "fileio.h" #include "formats-util.h" -#include "gunicode.h" #include "hashmap.h" -#include "hexdecoct.h" #include "hostname-util.h" -#include "ioprio.h" #include "log.h" #include "macro.h" #include "missing.h" -#include "mkdir.h" #include "parse-util.h" #include "path-util.h" #include "process-util.h" -#include "random-util.h" #include "signal-util.h" -#include "sparse-endian.h" +#include "set.h" +#include "time-util.h" #include "stat-util.h" -#include "string-table.h" #include "string-util.h" #include "strv.h" -#include "terminal-util.h" #include "user-util.h" -#include "utf8.h" #include "util.h" -#include "virt.h" /* Put this test here for a lack of better place */ assert_cc(EAGAIN == EWOULDBLOCK); diff --git a/src/basic/util.h b/src/basic/util.h index d9d2f72b75..76a06822b7 100644 --- a/src/basic/util.h +++ b/src/basic/util.h @@ -22,6 +22,7 @@ ***/ #include <alloca.h> +#include <errno.h> #include <fcntl.h> #include <inttypes.h> #include <limits.h> @@ -29,8 +30,10 @@ #include <stdarg.h> #include <stdbool.h> #include <stddef.h> +#include <stdint.h> #include <stdio.h> #include <stdlib.h> +#include <string.h> #include <sys/inotify.h> #include <sys/socket.h> #include <sys/stat.h> diff --git a/src/basic/verbs.c b/src/basic/verbs.c index d63062d39e..7feb47c48e 100644 --- a/src/basic/verbs.c +++ b/src/basic/verbs.c @@ -19,8 +19,14 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> +#include <getopt.h> +#include <stdbool.h> +#include <stddef.h> + +#include "log.h" +#include "macro.h" #include "string-util.h" -#include "util.h" #include "verbs.h" int dispatch_verb(int argc, char *argv[], const Verb verbs[], void *userdata) { diff --git a/src/basic/virt.c b/src/basic/virt.c index b82680a54b..eb67949166 100644 --- a/src/basic/virt.c +++ b/src/basic/virt.c @@ -20,18 +20,18 @@ ***/ #include <errno.h> +#include <stdint.h> +#include <stdlib.h> #include <string.h> #include <unistd.h> #include "alloc-util.h" -#include "dirent-util.h" -#include "fd-util.h" #include "fileio.h" #include "process-util.h" +#include "macro.h" #include "stat-util.h" #include "string-table.h" #include "string-util.h" -#include "util.h" #include "virt.h" static int detect_vm_cpuid(void) { diff --git a/src/basic/xattr-util.c b/src/basic/xattr-util.c index 6abdaedc3e..166e2b23fa 100644 --- a/src/basic/xattr-util.c +++ b/src/basic/xattr-util.c @@ -19,13 +19,20 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> +#include <fcntl.h> +#include <stdint.h> +#include <stdlib.h> +#include <string.h> +#include <sys/time.h> #include <sys/xattr.h> #include "alloc-util.h" #include "fd-util.h" #include "sparse-endian.h" +#include "macro.h" +#include "time-util.h" #include "stdio-util.h" -#include "util.h" #include "xattr-util.h" int getxattr_malloc(const char *path, const char *name, char **value, bool allow_symlink) { diff --git a/src/basic/xattr-util.h b/src/basic/xattr-util.h index cf4cb12a25..a5134cba89 100644 --- a/src/basic/xattr-util.h +++ b/src/basic/xattr-util.h @@ -22,6 +22,7 @@ ***/ #include <stdbool.h> +#include <stddef.h> #include <sys/types.h> #include "time-util.h" diff --git a/src/basic/xml.c b/src/basic/xml.c index 8126bce212..b9976cf5f1 100644 --- a/src/basic/xml.c +++ b/src/basic/xml.c @@ -19,10 +19,12 @@ along with systemd; If not, see <http://www.gnu.org/licenses/>. ***/ +#include <errno.h> +#include <stddef.h> #include <string.h> +#include "macro.h" #include "string-util.h" -#include "util.h" #include "xml.h" enum { |