summaryrefslogtreecommitdiff
path: root/src/shared
diff options
context:
space:
mode:
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/acl-util.c5
-rw-r--r--src/shared/architecture.c1
-rw-r--r--src/shared/ask-password-api.c1
-rw-r--r--src/shared/base-filesystem.c5
-rw-r--r--src/shared/bus-util.c2
-rw-r--r--src/shared/bus-util.h4
-rw-r--r--src/shared/cgroup-show.c13
-rw-r--r--src/shared/clean-ipc.c13
-rw-r--r--src/shared/condition.c1
-rw-r--r--src/shared/conf-parser.c14
-rw-r--r--src/shared/dns-domain.c1
-rw-r--r--src/shared/dropin.c1
-rw-r--r--src/shared/fstab-util.c3
-rw-r--r--src/shared/generator.c1
-rw-r--r--src/shared/import-util.c1
-rw-r--r--src/shared/install.c21
-rw-r--r--src/shared/logs-show.c22
-rw-r--r--src/shared/machine-image.c2
-rw-r--r--src/shared/machine-pool.c11
-rw-r--r--src/shared/pager.c13
-rw-r--r--src/shared/path-lookup.c3
-rw-r--r--src/shared/seccomp-util.c1
-rw-r--r--src/shared/sleep-config.c3
-rw-r--r--src/shared/specifier.c3
-rw-r--r--src/shared/switch-root.c15
-rw-r--r--src/shared/sysctl-util.c1
-rw-r--r--src/shared/utmp-wtmp.c9
27 files changed, 98 insertions, 72 deletions
diff --git a/src/shared/acl-util.c b/src/shared/acl-util.c
index bd8c988751..47295ae379 100644
--- a/src/shared/acl-util.c
+++ b/src/shared/acl-util.c
@@ -22,9 +22,10 @@
#include <errno.h>
#include <stdbool.h>
-#include "acl-util.h"
-#include "util.h"
+#include "string-util.h"
#include "strv.h"
+#include "util.h"
+#include "acl-util.h"
int acl_find_uid(acl_t acl, uid_t uid, acl_entry_t *entry) {
acl_entry_t i;
diff --git a/src/shared/architecture.c b/src/shared/architecture.c
index 8e72e7a36a..e5efcd77b6 100644
--- a/src/shared/architecture.c
+++ b/src/shared/architecture.c
@@ -21,6 +21,7 @@
#include <sys/utsname.h>
+#include "string-util.h"
#include "architecture.h"
int uname_architecture(void) {
diff --git a/src/shared/ask-password-api.c b/src/shared/ask-password-api.c
index ddf42f11e1..4bf87576f2 100644
--- a/src/shared/ask-password-api.c
+++ b/src/shared/ask-password-api.c
@@ -38,6 +38,7 @@
#include "random-util.h"
#include "signal-util.h"
#include "socket-util.h"
+#include "string-util.h"
#include "strv.h"
#include "terminal-util.h"
#include "util.h"
diff --git a/src/shared/base-filesystem.c b/src/shared/base-filesystem.c
index 48492ed13d..f2796c6d64 100644
--- a/src/shared/base-filesystem.c
+++ b/src/shared/base-filesystem.c
@@ -20,14 +20,15 @@
***/
#include <errno.h>
-#include <sys/stat.h>
#include <stdlib.h>
+#include <sys/stat.h>
#include <unistd.h>
-#include "base-filesystem.h"
#include "log.h"
#include "macro.h"
+#include "string-util.h"
#include "util.h"
+#include "base-filesystem.h"
typedef struct BaseFilesystem {
const char *dir;
diff --git a/src/shared/bus-util.c b/src/shared/bus-util.c
index 13af8bfcce..bc77884751 100644
--- a/src/shared/bus-util.c
+++ b/src/shared/bus-util.c
@@ -38,11 +38,11 @@
#include "path-util.h"
#include "set.h"
#include "signal-util.h"
+#include "string-util.h"
#include "strv.h"
#include "unit-name.h"
#include "utf8.h"
#include "util.h"
-
#include "bus-util.h"
static int name_owner_change_callback(sd_bus_message *m, void *userdata, sd_bus_error *ret_error) {
diff --git a/src/shared/bus-util.h b/src/shared/bus-util.h
index fd70842b9e..3925c10fde 100644
--- a/src/shared/bus-util.h
+++ b/src/shared/bus-util.h
@@ -21,10 +21,12 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "sd-event.h"
#include "sd-bus.h"
+#include "sd-event.h"
+
#include "hashmap.h"
#include "install.h"
+#include "string-util.h"
#include "time-util.h"
typedef enum BusTransport {
diff --git a/src/shared/cgroup-show.c b/src/shared/cgroup-show.c
index 31b4f6c684..57b7aeb228 100644
--- a/src/shared/cgroup-show.c
+++ b/src/shared/cgroup-show.c
@@ -19,19 +19,20 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <stdio.h>
-#include <string.h>
#include <dirent.h>
#include <errno.h>
+#include <stdio.h>
+#include <string.h>
-#include "util.h"
+#include "cgroup-util.h"
#include "formats-util.h"
-#include "process-util.h"
#include "macro.h"
#include "path-util.h"
-#include "cgroup-util.h"
-#include "cgroup-show.h"
+#include "process-util.h"
+#include "string-util.h"
#include "terminal-util.h"
+#include "util.h"
+#include "cgroup-show.h"
static int compare(const void *a, const void *b) {
const pid_t *p = a, *q = b;
diff --git a/src/shared/clean-ipc.c b/src/shared/clean-ipc.c
index d1cdb151b2..baf4bc0b87 100644
--- a/src/shared/clean-ipc.c
+++ b/src/shared/clean-ipc.c
@@ -19,18 +19,19 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <dirent.h>
+#include <fcntl.h>
+#include <mqueue.h>
#include <sys/ipc.h>
-#include <sys/shm.h>
-#include <sys/sem.h>
#include <sys/msg.h>
+#include <sys/sem.h>
+#include <sys/shm.h>
#include <sys/stat.h>
-#include <fcntl.h>
-#include <dirent.h>
-#include <mqueue.h>
-#include "util.h"
#include "formats-util.h"
+#include "string-util.h"
#include "strv.h"
+#include "util.h"
#include "clean-ipc.h"
static int clean_sysvipc_shm(uid_t delete_uid) {
diff --git a/src/shared/condition.c b/src/shared/condition.c
index 6987cf7120..2556436542 100644
--- a/src/shared/condition.c
+++ b/src/shared/condition.c
@@ -37,6 +37,7 @@
#include "path-util.h"
#include "selinux-util.h"
#include "smack-util.h"
+#include "string-util.h"
#include "util.h"
#include "virt.h"
#include "condition.h"
diff --git a/src/shared/conf-parser.c b/src/shared/conf-parser.c
index c282fb1231..3f2e34c2e3 100644
--- a/src/shared/conf-parser.c
+++ b/src/shared/conf-parser.c
@@ -19,20 +19,22 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <string.h>
-#include <stdio.h>
#include <errno.h>
+#include <stdio.h>
#include <stdlib.h>
+#include <string.h>
#include "sd-messages.h"
+
#include "conf-files.h"
-#include "util.h"
-#include "macro.h"
-#include "strv.h"
#include "log.h"
-#include "utf8.h"
+#include "macro.h"
#include "path-util.h"
#include "signal-util.h"
+#include "string-util.h"
+#include "strv.h"
+#include "utf8.h"
+#include "util.h"
#include "conf-parser.h"
int config_item_table_lookup(
diff --git a/src/shared/dns-domain.c b/src/shared/dns-domain.c
index 5680f01bd9..d4df9d2acb 100644
--- a/src/shared/dns-domain.c
+++ b/src/shared/dns-domain.c
@@ -24,6 +24,7 @@
#include <stringprep.h>
#endif
+#include "string-util.h"
#include "dns-domain.h"
int dns_label_unescape(const char **name, char *dest, size_t sz) {
diff --git a/src/shared/dropin.c b/src/shared/dropin.c
index 5e0436a55d..52ea8086fe 100644
--- a/src/shared/dropin.c
+++ b/src/shared/dropin.c
@@ -23,6 +23,7 @@
#include "escape.h"
#include "fileio-label.h"
#include "mkdir.h"
+#include "string-util.h"
#include "strv.h"
#include "util.h"
#include "dropin.h"
diff --git a/src/shared/fstab-util.c b/src/shared/fstab-util.c
index c065adcfdf..bdfc13e3cd 100644
--- a/src/shared/fstab-util.c
+++ b/src/shared/fstab-util.c
@@ -19,10 +19,11 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include "fstab-util.h"
#include "path-util.h"
+#include "string-util.h"
#include "strv.h"
#include "util.h"
+#include "fstab-util.h"
bool fstab_is_mount_point(const char *mount) {
_cleanup_endmntent_ FILE *f = NULL;
diff --git a/src/shared/generator.c b/src/shared/generator.c
index 264a54fb94..b52b9623fa 100644
--- a/src/shared/generator.c
+++ b/src/shared/generator.c
@@ -28,6 +28,7 @@
#include "mkdir.h"
#include "path-util.h"
#include "special.h"
+#include "string-util.h"
#include "unit-name.h"
#include "util.h"
#include "generator.h"
diff --git a/src/shared/import-util.c b/src/shared/import-util.c
index 56388d5dd6..c4c66c847d 100644
--- a/src/shared/import-util.c
+++ b/src/shared/import-util.c
@@ -20,6 +20,7 @@
***/
#include "btrfs-util.h"
+#include "string-util.h"
#include "util.h"
#include "import-util.h"
diff --git a/src/shared/install.c b/src/shared/install.c
index 238433c808..5368623b74 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -21,23 +21,24 @@
#include <errno.h>
#include <fcntl.h>
-#include <unistd.h>
-#include <string.h>
#include <fnmatch.h>
+#include <string.h>
+#include <unistd.h>
-#include "util.h"
-#include "mkdir.h"
+#include "conf-files.h"
+#include "conf-parser.h"
#include "hashmap.h"
-#include "set.h"
-#include "path-util.h"
+#include "install-printf.h"
+#include "mkdir.h"
#include "path-lookup.h"
+#include "path-util.h"
+#include "set.h"
+#include "special.h"
+#include "string-util.h"
#include "strv.h"
#include "unit-name.h"
+#include "util.h"
#include "install.h"
-#include "conf-parser.h"
-#include "conf-files.h"
-#include "install-printf.h"
-#include "special.h"
typedef struct {
OrderedHashmap *will_install;
diff --git a/src/shared/logs-show.c b/src/shared/logs-show.c
index dbc07aa7ad..cb4a0d2172 100644
--- a/src/shared/logs-show.c
+++ b/src/shared/logs-show.c
@@ -19,25 +19,25 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <time.h>
#include <errno.h>
-#include <sys/socket.h>
-#include <string.h>
#include <fcntl.h>
+#include <string.h>
+#include <sys/socket.h>
+#include <time.h>
-#include "logs-show.h"
-#include "log.h"
-#include "util.h"
-#include "utf8.h"
+#include "formats-util.h"
#include "hashmap.h"
+#include "hostname-util.h"
#include "journal-internal.h"
-#include "formats-util.h"
+#include "log.h"
#include "process-util.h"
+#include "string-util.h"
#include "terminal-util.h"
-#include "hostname-util.h"
+#include "utf8.h"
+#include "util.h"
+#include "logs-show.h"
-/* up to three lines (each up to 100 characters),
- or 300 characters, whichever is less */
+/* up to three lines (each up to 100 characters) or 300 characters, whichever is less */
#define PRINT_LINE_THRESHOLD 3
#define PRINT_CHAR_THRESHOLD 300
diff --git a/src/shared/machine-image.c b/src/shared/machine-image.c
index 8ed3ad7f44..8261d87091 100644
--- a/src/shared/machine-image.c
+++ b/src/shared/machine-image.c
@@ -28,9 +28,9 @@
#include "mkdir.h"
#include "path-util.h"
#include "rm-rf.h"
+#include "string-util.h"
#include "strv.h"
#include "utf8.h"
-
#include "machine-image.h"
static const char image_search_path[] =
diff --git a/src/shared/machine-pool.c b/src/shared/machine-pool.c
index 1da7d0815f..597680ef5f 100644
--- a/src/shared/machine-pool.c
+++ b/src/shared/machine-pool.c
@@ -19,18 +19,19 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
+#include <sys/mount.h>
#include <sys/prctl.h>
-#include <sys/vfs.h>
#include <sys/statvfs.h>
-#include <sys/mount.h>
+#include <sys/vfs.h>
-#include "util.h"
-#include "process-util.h"
+#include "btrfs-util.h"
#include "lockfile-util.h"
#include "mkdir.h"
-#include "btrfs-util.h"
#include "path-util.h"
+#include "process-util.h"
#include "signal-util.h"
+#include "string-util.h"
+#include "util.h"
#include "machine-pool.h"
#define VAR_LIB_MACHINES_SIZE_START (1024UL*1024UL*500UL)
diff --git a/src/shared/pager.c b/src/shared/pager.c
index d8f0fb404d..b82b526309 100644
--- a/src/shared/pager.c
+++ b/src/shared/pager.c
@@ -21,17 +21,18 @@
#include <fcntl.h>
#include <stdlib.h>
-#include <unistd.h>
#include <string.h>
#include <sys/prctl.h>
+#include <unistd.h>
-#include "pager.h"
-#include "util.h"
-#include "process-util.h"
+#include "copy.h"
#include "macro.h"
-#include "terminal-util.h"
+#include "process-util.h"
#include "signal-util.h"
-#include "copy.h"
+#include "string-util.h"
+#include "terminal-util.h"
+#include "util.h"
+#include "pager.h"
static pid_t pager_pid = 0;
diff --git a/src/shared/path-lookup.c b/src/shared/path-lookup.c
index 897dc9065f..1e63c72047 100644
--- a/src/shared/path-lookup.c
+++ b/src/shared/path-lookup.c
@@ -27,8 +27,9 @@
#include "util.h"
#include "strv.h"
#include "path-util.h"
-#include "path-lookup.h"
#include "install.h"
+#include "string-util.h"
+#include "path-lookup.h"
int user_config_home(char **config_home) {
const char *e;
diff --git a/src/shared/seccomp-util.c b/src/shared/seccomp-util.c
index d73a74912e..c518cf83ec 100644
--- a/src/shared/seccomp-util.c
+++ b/src/shared/seccomp-util.c
@@ -21,6 +21,7 @@
#include <seccomp.h>
+#include "string-util.h"
#include "util.h"
#include "seccomp-util.h"
diff --git a/src/shared/sleep-config.c b/src/shared/sleep-config.c
index 3dedbd1f62..e69300b1db 100644
--- a/src/shared/sleep-config.c
+++ b/src/shared/sleep-config.c
@@ -22,11 +22,12 @@
#include <stdio.h>
#include "conf-parser.h"
-#include "sleep-config.h"
#include "fileio.h"
#include "log.h"
+#include "string-util.h"
#include "strv.h"
#include "util.h"
+#include "sleep-config.h"
#define USE(x, y) do{ (x) = (y); (y) = NULL; } while(0)
diff --git a/src/shared/specifier.c b/src/shared/specifier.c
index 85bd477f2d..610aec0df5 100644
--- a/src/shared/specifier.c
+++ b/src/shared/specifier.c
@@ -22,9 +22,10 @@
#include <string.h>
#include <sys/utsname.h>
+#include "hostname-util.h"
#include "macro.h"
+#include "string-util.h"
#include "util.h"
-#include "hostname-util.h"
#include "specifier.h"
/*
diff --git a/src/shared/switch-root.c b/src/shared/switch-root.c
index b12189cd10..205a2e1449 100644
--- a/src/shared/switch-root.c
+++ b/src/shared/switch-root.c
@@ -19,20 +19,21 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <sys/stat.h>
-#include <stdbool.h>
#include <errno.h>
+#include <fcntl.h>
+#include <stdbool.h>
#include <string.h>
#include <sys/mount.h>
+#include <sys/stat.h>
#include <unistd.h>
-#include <fcntl.h>
-#include "util.h"
-#include "path-util.h"
-#include "mkdir.h"
-#include "rm-rf.h"
#include "base-filesystem.h"
#include "missing.h"
+#include "mkdir.h"
+#include "path-util.h"
+#include "rm-rf.h"
+#include "string-util.h"
+#include "util.h"
#include "switch-root.h"
int switch_root(const char *new_root, const char *oldroot, bool detach_oldroot, unsigned long mountflags) {
diff --git a/src/shared/sysctl-util.c b/src/shared/sysctl-util.c
index b2cab948ef..21cb82ea1c 100644
--- a/src/shared/sysctl-util.c
+++ b/src/shared/sysctl-util.c
@@ -29,6 +29,7 @@
#include "fileio.h"
#include "log.h"
+#include "string-util.h"
#include "util.h"
#include "sysctl-util.h"
diff --git a/src/shared/utmp-wtmp.c b/src/shared/utmp-wtmp.c
index 63f1e4ca6f..235f10d1a6 100644
--- a/src/shared/utmp-wtmp.c
+++ b/src/shared/utmp-wtmp.c
@@ -19,18 +19,19 @@
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-#include <utmpx.h>
#include <errno.h>
+#include <fcntl.h>
+#include <poll.h>
#include <string.h>
#include <sys/utsname.h>
-#include <fcntl.h>
#include <unistd.h>
-#include <poll.h>
+#include <utmpx.h>
+#include "hostname-util.h"
#include "macro.h"
#include "path-util.h"
+#include "string-util.h"
#include "terminal-util.h"
-#include "hostname-util.h"
#include "utmp-wtmp.h"
int utmp_get_runlevel(int *runlevel, int *previous) {