]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
util-lib: split stat()/statfs()/stavfs() related calls into stat-util.[ch]
authorLennart Poettering <lennart@poettering.net>
Mon, 26 Oct 2015 21:01:44 +0000 (22:01 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 27 Oct 2015 12:25:56 +0000 (13:25 +0100)
37 files changed:
Makefile.am
src/basic/mkdir.c
src/basic/path-util.c
src/basic/path-util.h
src/basic/rm-rf.c
src/basic/stat-util.c [new file with mode: 0644]
src/basic/stat-util.h [new file with mode: 0644]
src/basic/terminal-util.c
src/basic/util.c
src/basic/util.h
src/core/dbus-manager.c
src/core/device.c
src/core/load-fragment.c
src/core/machine-id-setup.c
src/core/main.c
src/core/manager.c
src/core/path.c
src/core/unit.c
src/delta/delta.c
src/fstab-generator/fstab-generator.c
src/gpt-auto-generator/gpt-auto-generator.c
src/journal-remote/journal-remote.c
src/libsystemd/sd-device/sd-device.c
src/network/networkd-netdev.c
src/network/networkd-network.c
src/nspawn/nspawn-mount.c
src/nspawn/nspawn-register.c
src/nspawn/nspawn.c
src/shared/condition.c
src/shared/install.c
src/shared/machine-pool.c
src/systemctl/systemctl.c
src/sysv-generator/sysv-generator.c
src/test/test-util.c
src/tmpfiles/tmpfiles.c
src/udev/net/link-config.c
src/udev/udev-rules.c

index 810ced3326e6d477487dfb475d3ea4afdd44bd69..6f819cb9f2326ddb4b2cc0168026eec66f075ed6 100644 (file)
@@ -801,6 +801,8 @@ libbasic_la_SOURCES = \
        src/basic/chattr-util.h \
        src/basic/fs-util.c \
        src/basic/fs-util.h \
+       src/basic/stat-util.c \
+       src/basic/stat-util.h \
        src/basic/mount-util.c \
        src/basic/mount-util.h \
        src/basic/hexdecoct.c \
index 4fe90b2bb70a0a59ecf219ec89b47be35287c6b2..9410b33503e6f190482a65d165f546b5b3183f1c 100644 (file)
@@ -25,6 +25,7 @@
 #include "fs-util.h"
 #include "mkdir.h"
 #include "path-util.h"
+#include "stat-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) {
index 256a98f3e6e1514f59da5ad653417e0405111924..3783129f6950765f8a73810eb2da34d114356de5 100644 (file)
@@ -41,6 +41,7 @@
 #include "missing.h"
 #include "parse-util.h"
 #include "path-util.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "util.h"
@@ -455,43 +456,6 @@ char* path_join(const char *root, const char *path, const char *rest) {
                                NULL);
 }
 
-int path_is_read_only_fs(const char *path) {
-        struct statvfs st;
-
-        assert(path);
-
-        if (statvfs(path, &st) < 0)
-                return -errno;
-
-        if (st.f_flag & ST_RDONLY)
-                return true;
-
-        /* On NFS, statvfs() might not reflect whether we can actually
-         * write to the remote share. Let's try again with
-         * access(W_OK) which is more reliable, at least sometimes. */
-        if (access(path, W_OK) < 0 && errno == EROFS)
-                return true;
-
-        return false;
-}
-
-int path_is_os_tree(const char *path) {
-        char *p;
-        int r;
-
-        /* We use /usr/lib/os-release as flag file if something is an OS */
-        p = strjoina(path, "/usr/lib/os-release");
-        r = access(p, F_OK);
-        if (r >= 0)
-                return 1;
-
-        /* Also check for the old location in /etc, just in case. */
-        p = strjoina(path, "/etc/os-release");
-        r = access(p, F_OK);
-
-        return r >= 0;
-}
-
 int find_binary(const char *name, char **ret) {
         int last_error, r;
         const char *p;
index 193bf72468d74133f42feddd52ebea4f08a690cc..989e0f900498324103082dc5962287bd60fcd848 100644 (file)
@@ -52,9 +52,6 @@ int path_strv_make_absolute_cwd(char **l);
 char** path_strv_resolve(char **l, const char *prefix);
 char** path_strv_resolve_uniq(char **l, const char *prefix);
 
-int path_is_read_only_fs(const char *path);
-int path_is_os_tree(const char *path);
-
 int find_binary(const char *name, char **filename);
 
 bool paths_check_timestamp(const char* const* paths, usec_t *paths_ts_usec, bool update);
index f1850ea8a30e831a1df2ba9bbdf4e5ae70f9e3b0..8ec7dd75ee19d31d2d8c6a60974420018d4dcc68 100644 (file)
@@ -24,6 +24,7 @@
 #include "mount-util.h"
 #include "path-util.h"
 #include "rm-rf.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "util.h"
 
diff --git a/src/basic/stat-util.c b/src/basic/stat-util.c
new file mode 100644 (file)
index 0000000..3bc66b3
--- /dev/null
@@ -0,0 +1,216 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+/***
+  This file is part of systemd.
+
+  Copyright 2010-2012 Lennart Poettering
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as published by
+  the Free Software Foundation; either version 2.1 of the License, or
+  (at your option) any later version.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  Lesser General Public License for more details.
+
+  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 <fcntl.h>
+#include <linux/magic.h>
+#include <sys/statvfs.h>
+#include <unistd.h>
+
+#include "dirent-util.h"
+#include "fd-util.h"
+#include "macro.h"
+#include "missing.h"
+#include "stat-util.h"
+#include "string-util.h"
+
+int is_symlink(const char *path) {
+        struct stat info;
+
+        assert(path);
+
+        if (lstat(path, &info) < 0)
+                return -errno;
+
+        return !!S_ISLNK(info.st_mode);
+}
+
+int is_dir(const char* path, bool follow) {
+        struct stat st;
+        int r;
+
+        assert(path);
+
+        if (follow)
+                r = stat(path, &st);
+        else
+                r = lstat(path, &st);
+        if (r < 0)
+                return -errno;
+
+        return !!S_ISDIR(st.st_mode);
+}
+
+int is_device_node(const char *path) {
+        struct stat info;
+
+        assert(path);
+
+        if (lstat(path, &info) < 0)
+                return -errno;
+
+        return !!(S_ISBLK(info.st_mode) || S_ISCHR(info.st_mode));
+}
+
+int dir_is_empty(const char *path) {
+        _cleanup_closedir_ DIR *d;
+        struct dirent *de;
+
+        d = opendir(path);
+        if (!d)
+                return -errno;
+
+        FOREACH_DIRENT(de, d, return -errno)
+                return 0;
+
+        return 1;
+}
+
+bool null_or_empty(struct stat *st) {
+        assert(st);
+
+        if (S_ISREG(st->st_mode) && st->st_size <= 0)
+                return true;
+
+        /* We don't want to hardcode the major/minor of /dev/null,
+         * hence we do a simpler "is this a device node?" check. */
+
+        if (S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode))
+                return true;
+
+        return false;
+}
+
+int null_or_empty_path(const char *fn) {
+        struct stat st;
+
+        assert(fn);
+
+        if (stat(fn, &st) < 0)
+                return -errno;
+
+        return null_or_empty(&st);
+}
+
+int null_or_empty_fd(int fd) {
+        struct stat st;
+
+        assert(fd >= 0);
+
+        if (fstat(fd, &st) < 0)
+                return -errno;
+
+        return null_or_empty(&st);
+}
+
+int path_is_read_only_fs(const char *path) {
+        struct statvfs st;
+
+        assert(path);
+
+        if (statvfs(path, &st) < 0)
+                return -errno;
+
+        if (st.f_flag & ST_RDONLY)
+                return true;
+
+        /* On NFS, statvfs() might not reflect whether we can actually
+         * write to the remote share. Let's try again with
+         * access(W_OK) which is more reliable, at least sometimes. */
+        if (access(path, W_OK) < 0 && errno == EROFS)
+                return true;
+
+        return false;
+}
+
+int path_is_os_tree(const char *path) {
+        char *p;
+        int r;
+
+        assert(path);
+
+        /* We use /usr/lib/os-release as flag file if something is an OS */
+        p = strjoina(path, "/usr/lib/os-release");
+        r = access(p, F_OK);
+        if (r >= 0)
+                return 1;
+
+        /* Also check for the old location in /etc, just in case. */
+        p = strjoina(path, "/etc/os-release");
+        r = access(p, F_OK);
+
+        return r >= 0;
+}
+
+int files_same(const char *filea, const char *fileb) {
+        struct stat a, b;
+
+        assert(filea);
+        assert(fileb);
+
+        if (stat(filea, &a) < 0)
+                return -errno;
+
+        if (stat(fileb, &b) < 0)
+                return -errno;
+
+        return a.st_dev == b.st_dev &&
+               a.st_ino == b.st_ino;
+}
+
+bool is_fs_type(const struct statfs *s, statfs_f_type_t magic_value) {
+        assert(s);
+        assert_cc(sizeof(statfs_f_type_t) >= sizeof(s->f_type));
+
+        return F_TYPE_EQUAL(s->f_type, magic_value);
+}
+
+int fd_check_fstype(int fd, statfs_f_type_t magic_value) {
+        struct statfs s;
+
+        if (fstatfs(fd, &s) < 0)
+                return -errno;
+
+        return is_fs_type(&s, magic_value);
+}
+
+int path_check_fstype(const char *path, statfs_f_type_t magic_value) {
+        _cleanup_close_ int fd = -1;
+
+        fd = open(path, O_RDONLY);
+        if (fd < 0)
+                return -errno;
+
+        return fd_check_fstype(fd, magic_value);
+}
+
+bool is_temporary_fs(const struct statfs *s) {
+    return is_fs_type(s, TMPFS_MAGIC) ||
+           is_fs_type(s, RAMFS_MAGIC);
+}
+
+int fd_is_temporary_fs(int fd) {
+        struct statfs s;
+
+        if (fstatfs(fd, &s) < 0)
+                return -errno;
+
+        return is_temporary_fs(&s);
+}
diff --git a/src/basic/stat-util.h b/src/basic/stat-util.h
new file mode 100644 (file)
index 0000000..cb00e0f
--- /dev/null
@@ -0,0 +1,63 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+#pragma once
+
+/***
+  This file is part of systemd.
+
+  Copyright 2010-2012 Lennart Poettering
+
+  systemd is free software; you can redistribute it and/or modify it
+  under the terms of the GNU Lesser General Public License as published by
+  the Free Software Foundation; either version 2.1 of the License, or
+  (at your option) any later version.
+
+  systemd is distributed in the hope that it will be useful, but
+  WITHOUT ANY WARRANTY; without even the implied warranty of
+  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+  Lesser General Public License for more details.
+
+  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 <stdbool.h>
+#include <sys/stat.h>
+#include <sys/vfs.h>
+
+#include "macro.h"
+
+int is_symlink(const char *path);
+int is_dir(const char *path, bool follow);
+int is_device_node(const char *path);
+
+int dir_is_empty(const char *path);
+
+static inline int dir_is_populated(const char *path) {
+        int r;
+        r = dir_is_empty(path);
+        if (r < 0)
+                return r;
+        return !r;
+}
+
+bool null_or_empty(struct stat *st) _pure_;
+int null_or_empty_path(const char *fn);
+int null_or_empty_fd(int fd);
+
+int path_is_read_only_fs(const char *path);
+int path_is_os_tree(const char *path);
+
+int files_same(const char *filea, const char *fileb);
+
+/* The .f_type field of struct statfs is really weird defined on
+ * different archs. Let's use our own type we know is sufficiently
+ * larger to store the possible values. */
+typedef long statfs_f_type_t;
+
+bool is_fs_type(const struct statfs *s, statfs_f_type_t magic_value) _pure_;
+int fd_check_fstype(int fd, statfs_f_type_t magic_value);
+int path_check_fstype(const char *path, statfs_f_type_t magic_value);
+
+bool is_temporary_fs(const struct statfs *s) _pure_;
+int fd_is_temporary_fs(int fd);
index 1edceacfa2a9114608be65597626c47d48892df6..72fd4a080236f0a94ac67f0793f06889e12c8ec8 100644 (file)
@@ -39,6 +39,7 @@
 #include "path-util.h"
 #include "process-util.h"
 #include "socket-util.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "terminal-util.h"
 #include "time-util.h"
index b85e3c020a8f65ee277df9158679ed93ffab3cd8..30691dea6bc1fcbaab553acd27d0036d3be7d9c5 100644 (file)
 #include "util.h"
 #include "virt.h"
 #include "dirent-util.h"
+#include "stat-util.h"
 
 /* Put this test here for a lack of better place */
 assert_cc(EAGAIN == EWOULDBLOCK);
@@ -146,20 +147,6 @@ bool fstype_is_network(const char *fstype) {
         return nulstr_contains(table, fstype);
 }
 
-int dir_is_empty(const char *path) {
-        _cleanup_closedir_ DIR *d;
-        struct dirent *de;
-
-        d = opendir(path);
-        if (!d)
-                return -errno;
-
-        FOREACH_DIRENT(de, d, return -errno)
-                return 0;
-
-        return 1;
-}
-
 void rename_process(const char name[8]) {
         assert(name);
 
@@ -191,59 +178,6 @@ void rename_process(const char name[8]) {
         }
 }
 
-bool is_fs_type(const struct statfs *s, statfs_f_type_t magic_value) {
-        assert(s);
-        assert_cc(sizeof(statfs_f_type_t) >= sizeof(s->f_type));
-
-        return F_TYPE_EQUAL(s->f_type, magic_value);
-}
-
-int fd_check_fstype(int fd, statfs_f_type_t magic_value) {
-        struct statfs s;
-
-        if (fstatfs(fd, &s) < 0)
-                return -errno;
-
-        return is_fs_type(&s, magic_value);
-}
-
-int path_check_fstype(const char *path, statfs_f_type_t magic_value) {
-        _cleanup_close_ int fd = -1;
-
-        fd = open(path, O_RDONLY);
-        if (fd < 0)
-                return -errno;
-
-        return fd_check_fstype(fd, magic_value);
-}
-
-bool is_temporary_fs(const struct statfs *s) {
-    return is_fs_type(s, TMPFS_MAGIC) ||
-           is_fs_type(s, RAMFS_MAGIC);
-}
-
-int fd_is_temporary_fs(int fd) {
-        struct statfs s;
-
-        if (fstatfs(fd, &s) < 0)
-                return -errno;
-
-        return is_temporary_fs(&s);
-}
-
-int files_same(const char *filea, const char *fileb) {
-        struct stat a, b;
-
-        if (stat(filea, &a) < 0)
-                return -errno;
-
-        if (stat(fileb, &b) < 0)
-                return -errno;
-
-        return a.st_dev == b.st_dev &&
-               a.st_ino == b.st_ino;
-}
-
 int running_in_chroot(void) {
         int ret;
 
@@ -265,40 +199,6 @@ noreturn void freeze(void) {
                 pause();
 }
 
-bool null_or_empty(struct stat *st) {
-        assert(st);
-
-        if (S_ISREG(st->st_mode) && st->st_size <= 0)
-                return true;
-
-        if (S_ISCHR(st->st_mode) || S_ISBLK(st->st_mode))
-                return true;
-
-        return false;
-}
-
-int null_or_empty_path(const char *fn) {
-        struct stat st;
-
-        assert(fn);
-
-        if (stat(fn, &st) < 0)
-                return -errno;
-
-        return null_or_empty(&st);
-}
-
-int null_or_empty_fd(int fd) {
-        struct stat st;
-
-        assert(fd >= 0);
-
-        if (fstat(fd, &st) < 0)
-                return -errno;
-
-        return null_or_empty(&st);
-}
-
 static int do_execute(char **directories, usec_t timeout, char *argv[]) {
         _cleanup_hashmap_free_free_ Hashmap *pids = NULL;
         _cleanup_set_free_free_ Set *seen = NULL;
@@ -1508,38 +1408,6 @@ int update_reboot_param_file(const char *param) {
         return 0;
 }
 
-int is_symlink(const char *path) {
-        struct stat info;
-
-        if (lstat(path, &info) < 0)
-                return -errno;
-
-        return !!S_ISLNK(info.st_mode);
-}
-
-int is_dir(const char* path, bool follow) {
-        struct stat st;
-        int r;
-
-        if (follow)
-                r = stat(path, &st);
-        else
-                r = lstat(path, &st);
-        if (r < 0)
-                return -errno;
-
-        return !!S_ISDIR(st.st_mode);
-}
-
-int is_device_node(const char *path) {
-        struct stat info;
-
-        if (lstat(path, &info) < 0)
-                return -errno;
-
-        return !!(S_ISBLK(info.st_mode) || S_ISCHR(info.st_mode));
-}
-
 int syslog_parse_priority(const char **p, int *priority, bool with_facility) {
         int a = 0, b = 0, c = 0;
         int k;
index c268c6d0c389fdb8a8e8b24880cdedd6d0a3ef9d..6c6920c2a443db56bbf9e33a715244356a6f44bc 100644 (file)
@@ -141,39 +141,14 @@ ssize_t string_table_lookup(const char * const *table, size_t len, const char *k
 
 bool fstype_is_network(const char *fstype);
 
-int dir_is_empty(const char *path);
-
-static inline int dir_is_populated(const char *path) {
-        int r;
-        r = dir_is_empty(path);
-        if (r < 0)
-                return r;
-        return !r;
-}
-
-typedef long statfs_f_type_t;
-
-bool is_fs_type(const struct statfs *s, statfs_f_type_t magic_value) _pure_;
-int fd_check_fstype(int fd, statfs_f_type_t magic_value);
-int path_check_fstype(const char *path, statfs_f_type_t magic_value);
-
-bool is_temporary_fs(const struct statfs *s) _pure_;
-int fd_is_temporary_fs(int fd);
-
 #define xsprintf(buf, fmt, ...) \
         assert_message_se((size_t) snprintf(buf, ELEMENTSOF(buf), fmt, __VA_ARGS__) < ELEMENTSOF(buf), \
                           "xsprintf: " #buf "[] must be big enough")
 
-int files_same(const char *filea, const char *fileb);
-
 int running_in_chroot(void);
 
 noreturn void freeze(void);
 
-bool null_or_empty(struct stat *st) _pure_;
-int null_or_empty_path(const char *fn);
-int null_or_empty_fd(int fd);
-
 void execute_directories(const char* const* directories, usec_t timeout, char *argv[]);
 
 bool plymouth_running(void);
@@ -452,10 +427,6 @@ union file_handle_union {
 
 int update_reboot_param_file(const char *param);
 
-int is_symlink(const char *path);
-int is_dir(const char *path, bool follow);
-int is_device_node(const char *path);
-
 #define INOTIFY_EVENT_MAX (sizeof(struct inotify_event) + NAME_MAX + 1)
 
 #define FOREACH_INOTIFY_EVENT(e, buffer, sz) \
index 77a64dfd574452a91ad6b568f7d8eabd3d6ec5b2..f737140363db0dbda552f72102f338fa784bdb30 100644 (file)
@@ -41,6 +41,7 @@
 #include "log.h"
 #include "path-util.h"
 #include "selinux-access.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "virt.h"
index fb467a48765bf3f68d299a65dd27f8285dccf353..90bb2c45fda79628c5922c9ff3822c1f859a6959 100644 (file)
@@ -29,6 +29,7 @@
 #include "log.h"
 #include "parse-util.h"
 #include "path-util.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "swap.h"
 #include "udev-util.h"
index 688c4c7e0cae53c15cc254e5028b74d5d777c77a..89ab8f4cef903621e19a3e520d67433c3cf0a48e 100644 (file)
@@ -56,6 +56,7 @@
 #endif
 #include "securebits.h"
 #include "signal-util.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "unit-name.h"
index 921f0710681b8ac3f765f30cb1db60c9a7ed0df8..d9611ab7c67b22957dc74830f26142bb1f340f67 100644 (file)
@@ -41,6 +41,7 @@
 #include "mount-util.h"
 #include "path-util.h"
 #include "process-util.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "util.h"
 #include "virt.h"
index a931b10b9fad661c86eadddb347da8da4b0a9eaa..3e4e9199ed6510f1087d6f8c5fac6211c7d09d4c 100644 (file)
@@ -76,6 +76,7 @@
 #include "signal-util.h"
 #include "smack-setup.h"
 #include "special.h"
+#include "stat-util.h"
 #include "strv.h"
 #include "switch-root.h"
 #include "terminal-util.h"
index a56162ab5bd4851153714198811103d5d7f371d8..51e8b0566fccbee6d8d452d066553e835cb882fc 100644 (file)
@@ -72,6 +72,7 @@
 #include "rm-rf.h"
 #include "signal-util.h"
 #include "special.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "terminal-util.h"
index 11054d8c78bc0390512b597e81ae3138eb62a156..efd97d44eb965c07a96d3b43768f7ee31b4d9c37 100644 (file)
@@ -32,6 +32,7 @@
 #include "mkdir.h"
 #include "path.h"
 #include "special.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "unit-name.h"
 #include "unit.h"
index b44a2a5e2da16b2baa880ce40dfb6a55e647a628..11d3bb9633c2323f19df066c21fc8d126ec0edad 100644 (file)
@@ -49,6 +49,7 @@
 #include "process-util.h"
 #include "set.h"
 #include "special.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "unit-name.h"
index a40a92b5cb0ceac90ef91e54fb5bfd60b6c75dc8..e5e0be476f397b3210cf863152917bb1a4e4ed4a 100644 (file)
@@ -36,6 +36,7 @@
 #include "path-util.h"
 #include "process-util.h"
 #include "signal-util.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "terminal-util.h"
index fd0d01153a6cbf4fad1f4b7e601e6eaac6019197..64aa6db01a53aa1f0d96be1aeb25bdb729f575fc 100644 (file)
@@ -36,6 +36,7 @@
 #include "parse-util.h"
 #include "path-util.h"
 #include "special.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "unit-name.h"
index f315d5ff6ec8ffe56d921817e7ea2e1affe9bede..8bdb6c7548158e31c26c82ae31709962729b20fe 100644 (file)
@@ -42,6 +42,7 @@
 #include "parse-util.h"
 #include "path-util.h"
 #include "special.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "udev-util.h"
 #include "unit-name.h"
index 01c8e5c37ac52a28fe5e25c02177a2d868d0c135..b53b2abd760cf27c43a1902964f1b60b8b334075 100644 (file)
@@ -47,6 +47,7 @@
 #include "parse-util.h"
 #include "signal-util.h"
 #include "socket-util.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "strv.h"
 
index 13d1baa41d8d580414835cad1f673f30ee966d79..3b964de56bca4bb4701743f71513bf7e2f9a6733 100644 (file)
@@ -35,6 +35,7 @@
 #include "parse-util.h"
 #include "path-util.h"
 #include "set.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "strxcpyx.h"
index bd1129a09b9d52cce55e02ee732fdb8e198ff941..0ed52a8d68949572d9a6bf1aebeb3927b544d774 100644 (file)
@@ -30,6 +30,7 @@
 #include "networkd-netdev.h"
 #include "networkd.h"
 #include "siphash24.h"
+#include "stat-util.h"
 #include "string-util.h"
 
 const NetDevVTable * const netdev_vtable[_NETDEV_KIND_MAX] = {
index 6cef5fb7aa1d2e8a938fd2b43fd249c077683f60..eeb03df517d8367cfb493cb0af4884a7e033b4f4 100644 (file)
@@ -31,6 +31,7 @@
 #include "networkd-network.h"
 #include "networkd.h"
 #include "parse-util.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "util.h"
 
index 01e9a67d762ccdb55f2232abf58bf0d177c213ee..865407ec10934f7c6a9b2ddabc7582c2890a77ce 100644 (file)
@@ -33,6 +33,7 @@
 #include "path-util.h"
 #include "rm-rf.h"
 #include "set.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "util.h"
index b2776a61c26a2761fbc2ded117bc1a41f976c633..7139ad99586466a9806d84757c2cce9545c58bc2 100644 (file)
 
 #include "sd-bus.h"
 
-#include "util.h"
-#include "strv.h"
-#include "bus-util.h"
 #include "bus-error.h"
-
+#include "bus-util.h"
 #include "nspawn-register.h"
+#include "stat-util.h"
+#include "strv.h"
+#include "util.h"
 
 int register_machine(
                 const char *machine_name,
index c7ec511cca738481cc8e7e8105b9174caf809537..152846b8bf3e746e769600b3f2dfa2e137dcbea8 100644 (file)
@@ -90,6 +90,7 @@
 #endif
 #include "signal-util.h"
 #include "socket-util.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "terminal-util.h"
index 700bc92438f6b89d2c37c6b1dbd41d06131644ff..1c4c9419d0945a6e97433ada5388634c86c0e66e 100644 (file)
@@ -41,6 +41,7 @@
 #include "path-util.h"
 #include "selinux-util.h"
 #include "smack-util.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "util.h"
 #include "virt.h"
index 454fe79aa1a299229e77a47f9b7a498df9461b60..df381358f8790838ebbedaf39f954f90846d48e4 100644 (file)
@@ -38,6 +38,7 @@
 #include "path-util.h"
 #include "set.h"
 #include "special.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "unit-name.h"
index 6be1b7b2648cde27250885ddbff5421815f87940..1c7e0ef2c10433dac4923463b419408bf7b5a8be 100644 (file)
@@ -36,6 +36,7 @@
 #include "path-util.h"
 #include "process-util.h"
 #include "signal-util.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "util.h"
 
index 2b1caa619920601aec6e3d2a3687f015c259d565..91567600276c3c1c73350550ecdd47e179a19646 100644 (file)
@@ -73,6 +73,7 @@
 #include "spawn-ask-password-agent.h"
 #include "spawn-polkit-agent.h"
 #include "special.h"
+#include "stat-util.h"
 #include "strv.h"
 #include "terminal-util.h"
 #include "unit-name.h"
index 109732d74ebd03dc7a553e2a332ca06ae068b821..e4b02ca990cf27cce0cee291f522d8d59e803825 100644 (file)
 
 #include "fd-util.h"
 #include "hashmap.h"
+#include "hexdecoct.h"
 #include "install.h"
 #include "log.h"
 #include "mkdir.h"
-#include "hexdecoct.h"
 #include "path-lookup.h"
 #include "path-util.h"
 #include "set.h"
 #include "special.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "unit-name.h"
index d6fe7cd997b5e033be0f4ff231e5cef99365962c..d339bc686f61517f5db39856c61c1b849bf7f471 100644 (file)
@@ -47,6 +47,7 @@
 #include "process-util.h"
 #include "rm-rf.h"
 #include "signal-util.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "user-util.h"
index 090864becd26f442b75a5259fc0998077993465c..3b9fdf4378544960f08a12d35c86f5ba68506cda 100644 (file)
@@ -61,6 +61,7 @@
 #include "selinux-util.h"
 #include "set.h"
 #include "specifier.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "user-util.h"
index 7459ee1fe274ed408d219cbbc6e9ab47df6a9680..b4807dc0f72e78881bd2e93f28ce51c10949ccd1 100644 (file)
@@ -37,6 +37,7 @@
 #include "parse-util.h"
 #include "path-util.h"
 #include "random-util.h"
+#include "stat-util.h"
 #include "string-util.h"
 #include "strv.h"
 #include "util.h"
index 311d5156455e97c0af4cbf5ed2922a50d37f05d5..b87c14efb284f798491e7a31f48e0807099a022e 100644 (file)
@@ -33,6 +33,7 @@
 #include "escape.h"
 #include "fd-util.h"
 #include "path-util.h"
+#include "stat-util.h"
 #include "strbuf.h"
 #include "string-util.h"
 #include "strv.h"