summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/acl-util.c1
-rw-r--r--src/shared/acpi-fpdt.c2
-rw-r--r--src/shared/apparmor-util.c1
-rw-r--r--src/shared/arphrd-list.c1
-rw-r--r--src/shared/ask-password-api.h1
-rw-r--r--src/shared/audit.c7
-rw-r--r--src/shared/audit.h1
-rw-r--r--src/shared/barrier.c3
-rw-r--r--src/shared/barrier.h5
-rw-r--r--src/shared/base-filesystem.c5
-rw-r--r--src/shared/boot-timestamps.c1
-rw-r--r--src/shared/btrfs-util.c1
-rw-r--r--src/shared/bus-label.c3
-rw-r--r--src/shared/cap-list.c1
-rw-r--r--src/shared/capability.c5
-rw-r--r--src/shared/capability.h1
-rw-r--r--src/shared/cgroup-show.h1
-rw-r--r--src/shared/cgroup-util.c2
-rw-r--r--src/shared/clean-ipc.c1
-rw-r--r--src/shared/clock-util.c13
-rw-r--r--src/shared/clock-util.h1
-rw-r--r--src/shared/condition.c2
-rw-r--r--src/shared/conf-files.c3
-rw-r--r--src/shared/conf-files.h1
-rw-r--r--src/shared/conf-parser.c4
-rw-r--r--src/shared/dev-setup.c5
-rw-r--r--src/shared/device-nodes.c3
-rw-r--r--src/shared/efivars.c2
-rw-r--r--src/shared/efivars.h2
-rw-r--r--src/shared/env-util.c1
-rw-r--r--src/shared/env-util.h1
-rw-r--r--src/shared/errno-list.c1
-rw-r--r--src/shared/exit-status.c1
-rw-r--r--src/shared/fdset.c1
-rw-r--r--src/shared/fdset.h1
-rw-r--r--src/shared/fileio-label.c4
-rw-r--r--src/shared/generator.c1
-rw-r--r--src/shared/hashmap.c7
-rw-r--r--src/shared/install-printf.c1
-rw-r--r--src/shared/install.c1
-rw-r--r--src/shared/json.c1
-rw-r--r--src/shared/json.h1
-rw-r--r--src/shared/log.h2
-rw-r--r--src/shared/logs-show.c3
-rw-r--r--src/shared/logs-show.h1
-rw-r--r--src/shared/machine-image.c1
-rw-r--r--src/shared/memfd-util.c2
-rw-r--r--src/shared/memfd-util.h5
-rw-r--r--src/shared/mkdir-label.c6
-rw-r--r--src/shared/mkdir.c5
-rw-r--r--src/shared/mkdir.h1
-rw-r--r--src/shared/pager.c1
-rw-r--r--src/shared/path-lookup.c3
-rw-r--r--src/shared/path-util.c3
-rw-r--r--src/shared/pty.c6
-rw-r--r--src/shared/pty.h5
-rw-r--r--src/shared/ptyfwd.c1
-rw-r--r--src/shared/ptyfwd.h3
-rw-r--r--src/shared/ratelimit.c2
-rw-r--r--src/shared/ring.c1
-rw-r--r--src/shared/ring.h5
-rw-r--r--src/shared/selinux-util.c1
-rw-r--r--src/shared/selinux-util.h1
-rw-r--r--src/shared/socket-label.c8
-rw-r--r--src/shared/socket-util.c7
-rw-r--r--src/shared/socket-util.h1
-rw-r--r--src/shared/spawn-ask-password-agent.c4
-rw-r--r--src/shared/spawn-polkit-agent.c4
-rw-r--r--src/shared/strbuf.h2
-rw-r--r--src/shared/strv.c1
-rw-r--r--src/shared/strxcpyx.h2
-rw-r--r--src/shared/time-dst.c6
-rw-r--r--src/shared/unit-name.c1
-rw-r--r--src/shared/util.c3
-rw-r--r--src/shared/util.h3
-rw-r--r--src/shared/utmp-wtmp.c1
76 files changed, 5 insertions, 197 deletions
diff --git a/src/shared/acl-util.c b/src/shared/acl-util.c
index a4ff1ab87..34707e6b3 100644
--- a/src/shared/acl-util.c
+++ b/src/shared/acl-util.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <errno.h>
#include <stdbool.h>
diff --git a/src/shared/acpi-fpdt.c b/src/shared/acpi-fpdt.c
index 390c3236e..64e50401b 100644
--- a/src/shared/acpi-fpdt.c
+++ b/src/shared/acpi-fpdt.c
@@ -19,13 +19,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdlib.h>
#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include <unistd.h>
#include <fcntl.h>
-#include <sys/types.h>
#include <util.h>
#include <fileio.h>
diff --git a/src/shared/apparmor-util.c b/src/shared/apparmor-util.c
index c14843da4..c2bbd330b 100644
--- a/src/shared/apparmor-util.c
+++ b/src/shared/apparmor-util.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <unistd.h>
#include "util.h"
#include "fileio.h"
diff --git a/src/shared/arphrd-list.c b/src/shared/arphrd-list.c
index 6e113eff7..284043cd9 100644
--- a/src/shared/arphrd-list.c
+++ b/src/shared/arphrd-list.c
@@ -20,7 +20,6 @@
***/
#include <net/if_arp.h>
-#include <sys/socket.h>
#include <string.h>
#include "util.h"
diff --git a/src/shared/ask-password-api.h b/src/shared/ask-password-api.h
index 704ee6e1b..0954e072b 100644
--- a/src/shared/ask-password-api.h
+++ b/src/shared/ask-password-api.h
@@ -21,7 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "util.h"
int ask_password_tty(const char *message, usec_t until, bool echo, const char *flag_file, char **_passphrase);
diff --git a/src/shared/audit.c b/src/shared/audit.c
index 4701c0a8d..4c1496f60 100644
--- a/src/shared/audit.c
+++ b/src/shared/audit.c
@@ -19,20 +19,13 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
-#include <string.h>
-#include <unistd.h>
#include <errno.h>
-#include <stdlib.h>
#include <stdio.h>
-#include <ctype.h>
#include "macro.h"
#include "audit.h"
#include "util.h"
-#include "log.h"
#include "fileio.h"
-#include "virt.h"
int audit_session_from_pid(pid_t pid, uint32_t *id) {
_cleanup_free_ char *s = NULL;
diff --git a/src/shared/audit.h b/src/shared/audit.h
index b4aecffb3..7e9c929ac 100644
--- a/src/shared/audit.h
+++ b/src/shared/audit.h
@@ -23,7 +23,6 @@
#include <sys/types.h>
-#include "capability.h"
int audit_session_from_pid(pid_t pid, uint32_t *id);
int audit_loginuid_from_pid(pid_t pid, uid_t *uid);
diff --git a/src/shared/barrier.c b/src/shared/barrier.c
index f65363a67..ec121d740 100644
--- a/src/shared/barrier.c
+++ b/src/shared/barrier.c
@@ -21,13 +21,10 @@
#include <errno.h>
#include <fcntl.h>
-#include <limits.h>
#include <poll.h>
#include <stdbool.h>
#include <stdint.h>
-#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <sys/eventfd.h>
#include <sys/types.h>
#include <unistd.h>
diff --git a/src/shared/barrier.h b/src/shared/barrier.h
index d4ad2a419..7816fae57 100644
--- a/src/shared/barrier.h
+++ b/src/shared/barrier.h
@@ -21,14 +21,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <errno.h>
-#include <inttypes.h>
-#include <stdlib.h>
-#include <string.h>
#include <sys/types.h>
#include "macro.h"
-#include "util.h"
/* See source file for an API description. */
diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c
index 73907c635..6bd317f35 100644
--- a/src/shared/base-filesystem.c
+++ b/src/shared/base-filesystem.c
@@ -22,17 +22,12 @@
#include <errno.h>
#include <sys/stat.h>
#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
#include <unistd.h>
#include "base-filesystem.h"
#include "log.h"
#include "macro.h"
-#include "strv.h"
#include "util.h"
-#include "label.h"
-#include "mkdir.h"
typedef struct BaseFilesystem {
const char *dir;
diff --git a/src/shared/boot-timestamps.c b/src/shared/boot-timestamps.c
index 54e0537a2..68419595f 100644
--- a/src/shared/boot-timestamps.c
+++ b/src/shared/boot-timestamps.c
@@ -19,7 +19,6 @@
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <unistd.h>
#include "boot-timestamps.h"
#include "acpi-fpdt.h"
diff --git a/src/shared/btrfs-util.c b/src/shared/btrfs-util.c
index b34ac8b15..2a70dfea4 100644
--- a/src/shared/btrfs-util.c
+++ b/src/shared/btrfs-util.c
@@ -31,7 +31,6 @@
#include "util.h"
#include "path-util.h"
#include "macro.h"
-#include "strv.h"
#include "copy.h"
#include "selinux-util.h"
#include "smack-util.h"
diff --git a/src/shared/bus-label.c b/src/shared/bus-label.c
index 61eb75bca..9e9eaf400 100644
--- a/src/shared/bus-label.c
+++ b/src/shared/bus-label.c
@@ -19,13 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <stdlib.h>
-#include <unistd.h>
#include "util.h"
#include "macro.h"
-#include "def.h"
#include "bus-label.h"
diff --git a/src/shared/cap-list.c b/src/shared/cap-list.c
index 8033e8c7b..bd5bffbfa 100644
--- a/src/shared/cap-list.c
+++ b/src/shared/cap-list.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <linux/capability.h>
#include <string.h>
#include "util.h"
diff --git a/src/shared/capability.c b/src/shared/capability.c
index 915ceb9d9..4840c3ebf 100644
--- a/src/shared/capability.c
+++ b/src/shared/capability.c
@@ -19,14 +19,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
-#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <stdio.h>
-#include <sys/types.h>
-#include <stdarg.h>
-#include <ctype.h>
#include <sys/capability.h>
#include <sys/prctl.h>
#include "grp.h"
diff --git a/src/shared/capability.h b/src/shared/capability.h
index 6f2f6f997..8260ae1a8 100644
--- a/src/shared/capability.h
+++ b/src/shared/capability.h
@@ -21,7 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <inttypes.h>
#include <stdbool.h>
#include <sys/capability.h>
diff --git a/src/shared/cgroup-show.h b/src/shared/cgroup-show.h
index 3146f56ca..aa832454b 100644
--- a/src/shared/cgroup-show.h
+++ b/src/shared/cgroup-show.h
@@ -23,7 +23,6 @@
#include <stdbool.h>
#include <sys/types.h>
-#include "util.h"
#include "logs-show.h"
int show_cgroup_by_path(const char *path, const char *prefix, unsigned columns, bool kernel_threads, OutputFlags flags);
diff --git a/src/shared/cgroup-util.c b/src/shared/cgroup-util.c
index dfd8689b7..05c3125ae 100644
--- a/src/shared/cgroup-util.c
+++ b/src/shared/cgroup-util.c
@@ -30,12 +30,10 @@
#include <ftw.h>
#include "cgroup-util.h"
-#include "log.h"
#include "set.h"
#include "macro.h"
#include "util.h"
#include "path-util.h"
-#include "strv.h"
#include "unit-name.h"
#include "fileio.h"
#include "special.h"
diff --git a/src/shared/clean-ipc.c b/src/shared/clean-ipc.c
index 39ab64513..ea781f5de 100644
--- a/src/shared/clean-ipc.c
+++ b/src/shared/clean-ipc.c
@@ -24,7 +24,6 @@
#include <sys/sem.h>
#include <sys/msg.h>
#include <sys/stat.h>
-#include <sys/mman.h>
#include <fcntl.h>
#include <dirent.h>
#include <mqueue.h>
diff --git a/src/shared/clock-util.c b/src/shared/clock-util.c
index 96684681a..e4e03df1e 100644
--- a/src/shared/clock-util.c
+++ b/src/shared/clock-util.c
@@ -19,29 +19,16 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
-#include <string.h>
-#include <unistd.h>
#include <errno.h>
-#include <stdlib.h>
-#include <signal.h>
#include <stdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
#include <fcntl.h>
#include <sys/ioctl.h>
-#include <stdarg.h>
-#include <ctype.h>
-#include <sys/prctl.h>
#include <sys/time.h>
#include <linux/rtc.h>
#include "macro.h"
#include "util.h"
-#include "log.h"
-#include "strv.h"
#include "clock-util.h"
-#include "fileio.h"
int clock_get_hwclock(struct tm *tm) {
_cleanup_close_ int fd = -1;
diff --git a/src/shared/clock-util.h b/src/shared/clock-util.h
index 198a7b275..8c2d23543 100644
--- a/src/shared/clock-util.h
+++ b/src/shared/clock-util.h
@@ -21,7 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "util.h"
int clock_is_localtime(void);
int clock_set_timezone(int *min);
diff --git a/src/shared/condition.c b/src/shared/condition.c
index da7560f05..f34b45f2a 100644
--- a/src/shared/condition.c
+++ b/src/shared/condition.c
@@ -23,14 +23,12 @@
#include <errno.h>
#include <string.h>
#include <unistd.h>
-#include <sys/statvfs.h>
#include <fnmatch.h>
#include "sd-id128.h"
#include "util.h"
#include "virt.h"
#include "path-util.h"
-#include "fileio.h"
#include "architecture.h"
#include "smack-util.h"
#include "apparmor-util.h"
diff --git a/src/shared/conf-files.c b/src/shared/conf-files.c
index db4937db8..9ab08355e 100644
--- a/src/shared/conf-files.c
+++ b/src/shared/conf-files.c
@@ -19,13 +19,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <string.h>
-#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
#include <stdio.h>
-#include <sys/stat.h>
#include <dirent.h>
#include "macro.h"
diff --git a/src/shared/conf-files.h b/src/shared/conf-files.h
index 368c112eb..3169a907f 100644
--- a/src/shared/conf-files.h
+++ b/src/shared/conf-files.h
@@ -22,7 +22,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "macro.h"
int conf_files_list(char ***strv, const char *suffix, const char *root, const char *dir, ...);
int conf_files_list_strv(char ***strv, const char *suffix, const char *root, const char* const* dirs);
diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c
index 0b1af6c57..2148a30c6 100644
--- a/src/shared/conf-parser.c
+++ b/src/shared/conf-parser.c
@@ -22,9 +22,7 @@
#include <string.h>
#include <stdio.h>
#include <errno.h>
-#include <assert.h>
#include <stdlib.h>
-#include <netinet/ether.h>
#include "conf-parser.h"
#include "conf-files.h"
@@ -34,8 +32,6 @@
#include "log.h"
#include "utf8.h"
#include "path-util.h"
-#include "set.h"
-#include "exit-status.h"
#include "sd-messages.h"
int log_syntax_internal(
diff --git a/src/shared/dev-setup.c b/src/shared/dev-setup.c
index e8b0810d2..cb15da8a5 100644
--- a/src/shared/dev-setup.c
+++ b/src/shared/dev-setup.c
@@ -20,15 +20,10 @@
***/
#include <errno.h>
-#include <sys/stat.h>
#include <stdlib.h>
-#include <string.h>
-#include <assert.h>
#include <unistd.h>
#include "dev-setup.h"
-#include "log.h"
-#include "macro.h"
#include "util.h"
#include "label.h"
diff --git a/src/shared/device-nodes.c b/src/shared/device-nodes.c
index 73e9edd29..8751797f5 100644
--- a/src/shared/device-nodes.c
+++ b/src/shared/device-nodes.c
@@ -19,10 +19,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdlib.h>
#include <stdio.h>
-#include <stdint.h>
-#include <sys/types.h>
#include "device-nodes.h"
#include "utf8.h"
diff --git a/src/shared/efivars.c b/src/shared/efivars.c
index 5b3c5f09c..4f8a81dcd 100644
--- a/src/shared/efivars.c
+++ b/src/shared/efivars.c
@@ -22,9 +22,7 @@
#include <unistd.h>
#include <string.h>
#include <fcntl.h>
-#include <ctype.h>
-#include "acpi-fpdt.h"
#include "util.h"
#include "utf8.h"
#include "efivars.h"
diff --git a/src/shared/efivars.h b/src/shared/efivars.h
index 82364565b..249289371 100644
--- a/src/shared/efivars.h
+++ b/src/shared/efivars.h
@@ -21,8 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
-#include <inttypes.h>
#include <stdbool.h>
#include "sd-id128.h"
diff --git a/src/shared/env-util.c b/src/shared/env-util.c
index 038246d21..00c2cdd8c 100644
--- a/src/shared/env-util.c
+++ b/src/shared/env-util.c
@@ -20,7 +20,6 @@
***/
#include <limits.h>
-#include <sys/param.h>
#include <unistd.h>
#include "strv.h"
diff --git a/src/shared/env-util.h b/src/shared/env-util.h
index 618441a65..9de362171 100644
--- a/src/shared/env-util.h
+++ b/src/shared/env-util.h
@@ -22,7 +22,6 @@
***/
#include <stdbool.h>
-#include <sys/types.h>
#include "macro.h"
diff --git a/src/shared/errno-list.c b/src/shared/errno-list.c
index c63296f29..34d133148 100644
--- a/src/shared/errno-list.c
+++ b/src/shared/errno-list.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <errno.h>
#include <string.h>
#include "util.h"
diff --git a/src/shared/exit-status.c b/src/shared/exit-status.c
index 5c73b4d3c..57022c5b8 100644
--- a/src/shared/exit-status.c
+++ b/src/shared/exit-status.c
@@ -20,7 +20,6 @@
***/
#include <stdlib.h>
-#include <sys/wait.h>
#include "exit-status.h"
#include "set.h"
diff --git a/src/shared/fdset.c b/src/shared/fdset.c
index 9e35ce5ce..31849272b 100644
--- a/src/shared/fdset.c
+++ b/src/shared/fdset.c
@@ -22,7 +22,6 @@
#include <errno.h>
#include <dirent.h>
#include <fcntl.h>
-#include <unistd.h>
#include "set.h"
#include "util.h"
diff --git a/src/shared/fdset.h b/src/shared/fdset.h
index c3c5e5228..340438d7c 100644
--- a/src/shared/fdset.h
+++ b/src/shared/fdset.h
@@ -22,7 +22,6 @@
***/
#include "set.h"
-#include "util.h"
typedef struct FDSet FDSet;
diff --git a/src/shared/fileio-label.c b/src/shared/fileio-label.c
index 5fd69e058..bec988ca7 100644
--- a/src/shared/fileio-label.c
+++ b/src/shared/fileio-label.c
@@ -19,13 +19,9 @@
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
-#include <sys/stat.h>
-#include <unistd.h>
#include "util.h"
#include "selinux-util.h"
-#include "label.h"
#include "fileio-label.h"
int write_string_file_atomic_label(const char *fn, const char *line) {
diff --git a/src/shared/generator.c b/src/shared/generator.c
index 7f16d5cbe..569b25bb7 100644
--- a/src/shared/generator.c
+++ b/src/shared/generator.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <string.h>
#include <unistd.h>
#include "util.h"
diff --git a/src/shared/hashmap.c b/src/shared/hashmap.c
index e63ba4bb5..48d750239 100644
--- a/src/shared/hashmap.c
+++ b/src/shared/hashmap.c
@@ -20,9 +20,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <stdlib.h>
-#include <string.h>
#include <errno.h>
#include "util.h"
@@ -31,9 +29,12 @@
#include "macro.h"
#include "siphash24.h"
#include "strv.h"
-#include "list.h"
#include "mempool.h"
+#ifdef ENABLE_DEBUG_HASHMAP
+#include "list.h"
+#endif
+
/*
* Implementation of hashmaps.
* Addressing: open
diff --git a/src/shared/install-printf.c b/src/shared/install-printf.c
index d853f1777..f62a0321e 100644
--- a/src/shared/install-printf.c
+++ b/src/shared/install-printf.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <stdlib.h>
#include "specifier.h"
diff --git a/src/shared/install.c b/src/shared/install.c
index 65f1c245c..95ba71855 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -36,7 +36,6 @@
#include "install.h"
#include "conf-parser.h"
#include "conf-files.h"
-#include "specifier.h"
#include "install-printf.h"
#include "special.h"
diff --git a/src/shared/json.c b/src/shared/json.c
index bb3d26f0e..45c8ecedb 100644
--- a/src/shared/json.c
+++ b/src/shared/json.c
@@ -23,7 +23,6 @@
#include <math.h>
#include "macro.h"
-#include "log.h"
#include "util.h"
#include "utf8.h"
#include "json.h"
diff --git a/src/shared/json.h b/src/shared/json.h
index a8457132e..55976d513 100644
--- a/src/shared/json.h
+++ b/src/shared/json.h
@@ -22,7 +22,6 @@
***/
#include <stdbool.h>
-#include <inttypes.h>
enum {
JSON_END,
diff --git a/src/shared/log.h b/src/shared/log.h
index b323b2f7d..2dedfa3fd 100644
--- a/src/shared/log.h
+++ b/src/shared/log.h
@@ -25,8 +25,6 @@
#include <stdarg.h>
#include <syslog.h>
#include <sys/signalfd.h>
-#include <sys/types.h>
-#include <unistd.h>
#include <errno.h>
#include "macro.h"
diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c
index c2495056d..944d6856c 100644
--- a/src/shared/logs-show.c
+++ b/src/shared/logs-show.c
@@ -20,9 +20,7 @@
***/
#include <time.h>
-#include <assert.h>
#include <errno.h>
-#include <poll.h>
#include <sys/socket.h>
#include <string.h>
#include <fcntl.h>
@@ -32,7 +30,6 @@
#include "util.h"
#include "utf8.h"
#include "hashmap.h"
-#include "fileio.h"
#include "journal-internal.h"
/* up to three lines (each up to 100 characters),
diff --git a/src/shared/logs-show.h b/src/shared/logs-show.h
index 8d9641e8a..569e1faa5 100644
--- a/src/shared/logs-show.h
+++ b/src/shared/logs-show.h
@@ -22,7 +22,6 @@
***/
#include <stdbool.h>
-#include <unistd.h>
#include <sys/types.h>
#include "sd-journal.h"
diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c
index 8d61507e8..c734f148a 100644
--- a/src/shared/machine-image.c
+++ b/src/shared/machine-image.c
@@ -23,7 +23,6 @@
#include <linux/fs.h>
#include <fcntl.h>
-#include "strv.h"
#include "utf8.h"
#include "btrfs-util.h"
#include "path-util.h"
diff --git a/src/shared/memfd-util.c b/src/shared/memfd-util.c
index 6624c5e7d..e99a738e1 100644
--- a/src/shared/memfd-util.c
+++ b/src/shared/memfd-util.c
@@ -21,7 +21,6 @@
#include <stdio.h>
#include <fcntl.h>
-#include <sys/ioctl.h>
#include <sys/mman.h>
#include <sys/prctl.h>
@@ -30,7 +29,6 @@
#endif
#include "util.h"
-#include "bus-label.h"
#include "memfd-util.h"
#include "utf8.h"
#include "missing.h"
diff --git a/src/shared/memfd-util.h b/src/shared/memfd-util.h
index cf588fe02..3ed551fb3 100644
--- a/src/shared/memfd-util.h
+++ b/src/shared/memfd-util.h
@@ -21,12 +21,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <inttypes.h>
-#include <sys/types.h>
-#include <stdio.h>
-#include "macro.h"
-#include "util.h"
int memfd_new(const char *name);
int memfd_new_and_map(const char *name, size_t sz, void **p);
diff --git a/src/shared/mkdir-label.c b/src/shared/mkdir-label.c
index ee11ac06f..76bbc1edd 100644
--- a/src/shared/mkdir-label.c
+++ b/src/shared/mkdir-label.c
@@ -20,16 +20,10 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
-#include <string.h>
#include <unistd.h>
-#include <errno.h>
-#include <stdlib.h>
#include <stdio.h>
#include "label.h"
-#include "util.h"
-#include "path-util.h"
#include "mkdir.h"
int mkdir_safe_label(const char *path, mode_t mode, uid_t uid, gid_t gid) {
diff --git a/src/shared/mkdir.c b/src/shared/mkdir.c
index beefd1052..b280618a9 100644
--- a/src/shared/mkdir.c
+++ b/src/shared/mkdir.c
@@ -19,14 +19,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <string.h>
-#include <unistd.h>
#include <errno.h>
-#include <stdlib.h>
-#include <stdio.h>
-#include "label.h"
#include "util.h"
#include "path-util.h"
#include "mkdir.h"
diff --git a/src/shared/mkdir.h b/src/shared/mkdir.h
index e317df300..2392d1fd1 100644
--- a/src/shared/mkdir.h
+++ b/src/shared/mkdir.h
@@ -22,7 +22,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdbool.h>
#include <sys/types.h>
int mkdir_safe(const char *path, mode_t mode, uid_t uid, gid_t gid);
diff --git a/src/shared/pager.c b/src/shared/pager.c
index 8635d9a60..f12bfb328 100644
--- a/src/shared/pager.c
+++ b/src/shared/pager.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
#include <fcntl.h>
#include <stdlib.h>
#include <unistd.h>
diff --git a/src/shared/path-lookup.c b/src/shared/path-lookup.c
index 291a2f405..fbf46cd40 100644
--- a/src/shared/path-lookup.c
+++ b/src/shared/path-lookup.c
@@ -19,15 +19,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
-#include <unistd.h>
#include <errno.h>
#include "util.h"
-#include "mkdir.h"
#include "strv.h"
#include "path-util.h"
#include "path-lookup.h"
diff --git a/src/shared/path-util.c b/src/shared/path-util.c
index 70bc1caa2..12d1ec321 100644
--- a/src/shared/path-util.c
+++ b/src/shared/path-util.c
@@ -19,15 +19,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
#include <stdlib.h>
-#include <signal.h>
#include <stdio.h>
#include <fcntl.h>
-#include <dirent.h>
#include <sys/statvfs.h>
#include "macro.h"
diff --git a/src/shared/pty.c b/src/shared/pty.c
index fbe6295ea..0f80f4863 100644
--- a/src/shared/pty.c
+++ b/src/shared/pty.c
@@ -44,18 +44,12 @@
#include <errno.h>
#include <fcntl.h>
-#include <limits.h>
-#include <linux/ioctl.h>
#include <signal.h>
#include <stdbool.h>
#include <stdint.h>
-#include <stdio.h>
#include <stdlib.h>
-#include <string.h>
#include <sys/epoll.h>
-#include <sys/eventfd.h>
#include <sys/ioctl.h>
-#include <sys/types.h>
#include <sys/uio.h>
#include <sys/wait.h>
#include <termios.h>
diff --git a/src/shared/pty.h b/src/shared/pty.h
index a87ceb58c..63c7db283 100644
--- a/src/shared/pty.h
+++ b/src/shared/pty.h
@@ -21,17 +21,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <errno.h>
#include <stdbool.h>
-#include <stdint.h>
-#include <stdlib.h>
-#include <string.h>
#include <unistd.h>
#include "barrier.h"
#include "macro.h"
#include "sd-event.h"
-#include "util.h"
typedef struct Pty Pty;
diff --git a/src/shared/ptyfwd.c b/src/shared/ptyfwd.c
index 164c9b6ff..9d4d61cef 100644
--- a/src/shared/ptyfwd.c
+++ b/src/shared/ptyfwd.c
@@ -20,7 +20,6 @@
***/
#include <sys/epoll.h>
-#include <sys/signalfd.h>
#include <sys/ioctl.h>
#include <limits.h>
#include <termios.h>
diff --git a/src/shared/ptyfwd.h b/src/shared/ptyfwd.h
index 6208a543d..6f84e4036 100644
--- a/src/shared/ptyfwd.h
+++ b/src/shared/ptyfwd.h
@@ -21,11 +21,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
-#include <signal.h>
#include <stdbool.h>
-#include "util.h"
#include "sd-event.h"
typedef struct PTYForward PTYForward;
diff --git a/src/shared/ratelimit.c b/src/shared/ratelimit.c
index 01b62b7b3..81fc9c19f 100644
--- a/src/shared/ratelimit.c
+++ b/src/shared/ratelimit.c
@@ -19,10 +19,8 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include "ratelimit.h"
-#include "log.h"
/* Modelled after Linux' lib/ratelimit.c by Dave Young
* <hidave.darkstar@gmail.com>, which is licensed GPLv2. */
diff --git a/src/shared/ring.c b/src/shared/ring.c
index 309075e34..681491846 100644
--- a/src/shared/ring.c
+++ b/src/shared/ring.c
@@ -20,7 +20,6 @@
***/
#include <errno.h>
-#include <inttypes.h>
#include <stdlib.h>
#include <string.h>
#include <sys/uio.h>
diff --git a/src/shared/ring.h b/src/shared/ring.h
index 1210aabdf..a7c44d1b5 100644
--- a/src/shared/ring.h
+++ b/src/shared/ring.h
@@ -21,11 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <errno.h>
-#include <inttypes.h>
-#include <stdlib.h>
-#include <string.h>
-#include <sys/uio.h>
typedef struct Ring Ring;
diff --git a/src/shared/selinux-util.c b/src/shared/selinux-util.c
index a2233e0cf..82c6924e3 100644
--- a/src/shared/selinux-util.c
+++ b/src/shared/selinux-util.c
@@ -20,7 +20,6 @@
***/
#include <errno.h>
-#include <unistd.h>
#include <malloc.h>
#include <sys/un.h>
diff --git a/src/shared/selinux-util.h b/src/shared/selinux-util.h
index a69444100..846718529 100644
--- a/src/shared/selinux-util.h
+++ b/src/shared/selinux-util.h
@@ -22,7 +22,6 @@
***/
#include <sys/socket.h>
-#include <stdio.h>
#include <stdbool.h>
bool mac_selinux_use(void);
diff --git a/src/shared/socket-label.c b/src/shared/socket-label.c
index 6806c5115..dfb8a1a43 100644
--- a/src/shared/socket-label.c
+++ b/src/shared/socket-label.c
@@ -19,24 +19,16 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
-#include <stdlib.h>
-#include <arpa/inet.h>
-#include <stdio.h>
-#include <net/if.h>
-#include <sys/types.h>
#include <sys/stat.h>
#include <stddef.h>
-#include <sys/ioctl.h>
#include "macro.h"
#include "util.h"
#include "mkdir.h"
#include "missing.h"
-#include "label.h"
#include "selinux-util.h"
#include "socket-util.h"
diff --git a/src/shared/socket-util.c b/src/shared/socket-util.c
index a4e26b1d8..74d90fa2a 100644
--- a/src/shared/socket-util.c
+++ b/src/shared/socket-util.c
@@ -19,24 +19,19 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
-#include <stdlib.h>
#include <arpa/inet.h>
#include <stdio.h>
#include <net/if.h>
#include <sys/types.h>
-#include <sys/stat.h>
#include <stddef.h>
-#include <sys/ioctl.h>
#include <netdb.h>
#include "macro.h"
-#include "util.h"
-#include "mkdir.h"
#include "path-util.h"
+#include "util.h"
#include "socket-util.h"
#include "missing.h"
#include "fileio.h"
diff --git a/src/shared/socket-util.h b/src/shared/socket-util.h
index 07d0aff72..2d2b90236 100644
--- a/src/shared/socket-util.h
+++ b/src/shared/socket-util.h
@@ -25,7 +25,6 @@
#include <netinet/in.h>
#include <netinet/ether.h>
#include <sys/un.h>
-#include <asm/types.h>
#include <linux/netlink.h>
#include <linux/if_packet.h>
diff --git a/src/shared/spawn-ask-password-agent.c b/src/shared/spawn-ask-password-agent.c
index ee267833e..0d7458806 100644
--- a/src/shared/spawn-ask-password-agent.c
+++ b/src/shared/spawn-ask-password-agent.c
@@ -19,13 +19,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
-#include <string.h>
-#include <sys/prctl.h>
#include <signal.h>
-#include <fcntl.h>
#include "log.h"
#include "util.h"
diff --git a/src/shared/spawn-polkit-agent.c b/src/shared/spawn-polkit-agent.c
index 8f259a8f3..bc1810da9 100644
--- a/src/shared/spawn-polkit-agent.c
+++ b/src/shared/spawn-polkit-agent.c
@@ -19,13 +19,9 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/types.h>
#include <stdlib.h>
#include <unistd.h>
-#include <string.h>
-#include <sys/prctl.h>
#include <signal.h>
-#include <fcntl.h>
#include <errno.h>
#include <poll.h>
diff --git a/src/shared/strbuf.h b/src/shared/strbuf.h
index 2347fd432..fbc4e5f2a 100644
--- a/src/shared/strbuf.h
+++ b/src/shared/strbuf.h
@@ -21,9 +21,7 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdarg.h>
#include <stdint.h>
-#include <stdbool.h>
struct strbuf {
char *buf;
diff --git a/src/shared/strv.c b/src/shared/strv.c
index e27ac6815..ee45ad1d0 100644
--- a/src/shared/strv.c
+++ b/src/shared/strv.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
diff --git a/src/shared/strxcpyx.h b/src/shared/strxcpyx.h
index 7be246d57..ccc7e52f3 100644
--- a/src/shared/strxcpyx.h
+++ b/src/shared/strxcpyx.h
@@ -21,8 +21,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdarg.h>
-#include <stdbool.h>
#include "macro.h"
diff --git a/src/shared/time-dst.c b/src/shared/time-dst.c
index 1ce6f721b..2797d1a79 100644
--- a/src/shared/time-dst.c
+++ b/src/shared/time-dst.c
@@ -21,18 +21,12 @@
You should have received a copy of the GNU Lesser General Public License
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <ctype.h>
#include <errno.h>
#include <stddef.h>
#include <stdio.h>
-#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <endian.h>
-#include <byteswap.h>
-#include <assert.h>
-#include <limits.h>
-#include <unistd.h>
#include <stdint.h>
#include <stdbool.h>
#include <sys/stat.h>
diff --git a/src/shared/unit-name.c b/src/shared/unit-name.c
index 21b66913c..0cc06f4f8 100644
--- a/src/shared/unit-name.c
+++ b/src/shared/unit-name.c
@@ -21,7 +21,6 @@
#include <errno.h>
#include <string.h>
-#include <assert.h>
#include "path-util.h"
#include "bus-label.h"
diff --git a/src/shared/util.c b/src/shared/util.c
index dc6528013..241e7520b 100644
--- a/src/shared/util.c
+++ b/src/shared/util.c
@@ -19,7 +19,6 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <assert.h>
#include <string.h>
#include <unistd.h>
#include <errno.h>
@@ -48,7 +47,6 @@
#include <pwd.h>
#include <netinet/ip.h>
#include <linux/kd.h>
-#include <dlfcn.h>
#include <sys/wait.h>
#include <sys/time.h>
#include <glob.h>
@@ -83,7 +81,6 @@
#include "missing.h"
#include "log.h"
#include "strv.h"
-#include "label.h"
#include "mkdir.h"
#include "path-util.h"
#include "exit-status.h"
diff --git a/src/shared/util.h b/src/shared/util.h
index 759d053c2..a9235536b 100644
--- a/src/shared/util.h
+++ b/src/shared/util.h
@@ -25,7 +25,6 @@
#include <fcntl.h>
#include <inttypes.h>
#include <time.h>
-#include <sys/time.h>
#include <stdarg.h>
#include <stdbool.h>
#include <stdlib.h>
@@ -36,12 +35,10 @@
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
-#include <sys/resource.h>
#include <stddef.h>
#include <unistd.h>
#include <locale.h>
#include <mntent.h>
-#include <sys/socket.h>
#include <sys/inotify.h>
#if SIZEOF_PID_T == 4
diff --git a/src/shared/utmp-wtmp.c b/src/shared/utmp-wtmp.c
index bdb962af3..7fb6fe3a6 100644
--- a/src/shared/utmp-wtmp.c
+++ b/src/shared/utmp-wtmp.c
@@ -21,7 +21,6 @@
#include <utmpx.h>
#include <errno.h>
-#include <assert.h>
#include <string.h>
#include <sys/utsname.h>
#include <fcntl.h>