]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
util-lib: introduce dirent-util.[ch] for directory entry calls
authorLennart Poettering <lennart@poettering.net>
Mon, 26 Oct 2015 19:07:55 +0000 (20:07 +0100)
committerLennart Poettering <lennart@poettering.net>
Tue, 27 Oct 2015 12:25:56 +0000 (13:25 +0100)
Also, move a couple of more path-related functions to path-util.c.

37 files changed:
Makefile.am
src/basic/cgroup-util.c
src/basic/conf-files.c
src/basic/copy.c
src/basic/dirent-util.c [new file with mode: 0644]
src/basic/dirent-util.h [new file with mode: 0644]
src/basic/fd-util.c
src/basic/fdset.c
src/basic/locale-util.c
src/basic/path-util.c
src/basic/path-util.h
src/basic/util.c
src/basic/util.h
src/bootchart/store.c
src/core/smack-setup.c
src/dbus1-generator/dbus1-generator.c
src/delta/delta.c
src/gpt-auto-generator/gpt-auto-generator.c
src/import/pull-common.c
src/journal/coredump-vacuum.c
src/journal/coredump.c
src/journal/journal-vacuum.c
src/journal/journald-server.c
src/journal/journald-stream.c
src/journal/sd-journal.c
src/libsystemd/sd-device/device-enumerator.c
src/libsystemd/sd-login/sd-login.c
src/login/logind-acl.c
src/login/logind-dbus.c
src/login/logind.c
src/machine/machined.c
src/shared/clean-ipc.c
src/shared/efivars.c
src/shared/install.c
src/shared/machine-image.c
src/test/test-cgroup-util.c
src/tty-ask-password-agent/tty-ask-password-agent.c

index efd1329adefa3f61839aa259895b94d5f1b6042d..563e2cc4eab9e8d8733fda8f5384cc272fbf337d 100644 (file)
@@ -793,6 +793,8 @@ libbasic_la_SOURCES = \
        src/basic/user-util.h \
        src/basic/rlimit-util.c \
        src/basic/rlimit-util.h \
+       src/basic/dirent-util.c \
+       src/basic/dirent-util.h \
        src/basic/mount-util.c \
        src/basic/mount-util.h \
        src/basic/hexdecoct.c \
index 232d6e8fe24ebfb45e5c90eef537f31b55ce038b..67dc29119217ff9156eef6a5360cfeb9bc6797f5 100644 (file)
@@ -30,6 +30,7 @@
 #include <unistd.h>
 
 #include "cgroup-util.h"
+#include "dirent-util.h"
 #include "extract-word.h"
 #include "fd-util.h"
 #include "fileio.h"
index 3af3fe392cc3f7a6418f42765348a49f4211007f..be9972fffffe6fc054ec12f6ab790166cf10bf07 100644 (file)
@@ -26,6 +26,7 @@
 #include <string.h>
 
 #include "conf-files.h"
+#include "dirent-util.h"
 #include "fd-util.h"
 #include "hashmap.h"
 #include "log.h"
index 4b410a74e50bb4bb7a3d627e5b8294ff3b5a7304..2d2d7ade3486cbbd2a964dd1ffdc32cd664292db 100644 (file)
@@ -24,6 +24,7 @@
 
 #include "btrfs-util.h"
 #include "copy.h"
+#include "dirent-util.h"
 #include "fd-util.h"
 #include "fileio.h"
 #include "io-util.h"
diff --git a/src/basic/dirent-util.c b/src/basic/dirent-util.c
new file mode 100644 (file)
index 0000000..c433d58
--- /dev/null
@@ -0,0 +1,81 @@
+/*-*- 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 <sys/stat.h>
+#include <sys/types.h>
+#include <unistd.h>
+
+#include "dirent-util.h"
+#include "string-util.h"
+
+int dirent_ensure_type(DIR *d, struct dirent *de) {
+        struct stat st;
+
+        assert(d);
+        assert(de);
+
+        if (de->d_type != DT_UNKNOWN)
+                return 0;
+
+        if (fstatat(dirfd(d), de->d_name, &st, AT_SYMLINK_NOFOLLOW) < 0)
+                return -errno;
+
+        de->d_type =
+                S_ISREG(st.st_mode)  ? DT_REG  :
+                S_ISDIR(st.st_mode)  ? DT_DIR  :
+                S_ISLNK(st.st_mode)  ? DT_LNK  :
+                S_ISFIFO(st.st_mode) ? DT_FIFO :
+                S_ISSOCK(st.st_mode) ? DT_SOCK :
+                S_ISCHR(st.st_mode)  ? DT_CHR  :
+                S_ISBLK(st.st_mode)  ? DT_BLK  :
+                                       DT_UNKNOWN;
+
+        return 0;
+}
+
+bool dirent_is_file(const struct dirent *de) {
+        assert(de);
+
+        if (hidden_file(de->d_name))
+                return false;
+
+        if (de->d_type != DT_REG &&
+            de->d_type != DT_LNK &&
+            de->d_type != DT_UNKNOWN)
+                return false;
+
+        return true;
+}
+
+bool dirent_is_file_with_suffix(const struct dirent *de, const char *suffix) {
+        assert(de);
+
+        if (de->d_type != DT_REG &&
+            de->d_type != DT_LNK &&
+            de->d_type != DT_UNKNOWN)
+                return false;
+
+        if (hidden_file_allow_backup(de->d_name))
+                return false;
+
+        return endswith(de->d_name, suffix);
+}
diff --git a/src/basic/dirent-util.h b/src/basic/dirent-util.h
new file mode 100644 (file)
index 0000000..5866a75
--- /dev/null
@@ -0,0 +1,51 @@
+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/
+
+#pragma once
+
+/***
+  This file is part of systemd.
+
+  Copyright 2010 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 <dirent.h>
+
+#include "path-util.h"
+
+int dirent_ensure_type(DIR *d, struct dirent *de);
+
+bool dirent_is_file(const struct dirent *de) _pure_;
+bool dirent_is_file_with_suffix(const struct dirent *de, const char *suffix) _pure_;
+
+#define FOREACH_DIRENT(de, d, on_error)                                 \
+        for (errno = 0, de = readdir(d);; errno = 0, de = readdir(d))   \
+                if (!de) {                                              \
+                        if (errno > 0) {                                \
+                                on_error;                               \
+                        }                                               \
+                        break;                                          \
+                } else if (hidden_file((de)->d_name))                   \
+                        continue;                                       \
+                else
+
+#define FOREACH_DIRENT_ALL(de, d, on_error)                             \
+        for (errno = 0, de = readdir(d);; errno = 0, de = readdir(d))   \
+                if (!de) {                                              \
+                        if (errno > 0) {                                \
+                                on_error;                               \
+                        }                                               \
+                        break;                                          \
+                } else
index 76d7e32bfa10cee5d2af23ddcd2674beab454204..f40365ce97032c7f92752d97ba52dbc626e22f30 100644 (file)
@@ -22,6 +22,7 @@
 #include "fd-util.h"
 #include "parse-util.h"
 #include "util.h"
+#include "dirent-util.h"
 
 int close_nointr(int fd) {
         assert(fd >= 0);
index ef60f664313bec4c49997c4578a28d1e5b98889a..4b11e4ea092013f58c6425c7c2d5481db9923f5b 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "sd-daemon.h"
 
+#include "dirent-util.h"
 #include "fd-util.h"
 #include "fdset.h"
 #include "macro.h"
index ccbc1479316e833372baf9a3f60f5c1d6f831ca6..08da4b98c5448c9e9d03b3d44575344f498d425c 100644 (file)
@@ -21,6 +21,7 @@
 
 #include <sys/mman.h>
 
+#include "dirent-util.h"
 #include "fd-util.h"
 #include "locale-util.h"
 #include "path-util.h"
index d581f85707dde2639d1a69b941306484f3683064..ed30c3d92dd5a86532bcf19925fb4302fd2efda4 100644 (file)
@@ -766,3 +766,70 @@ bool path_is_safe(const char *p) {
 
         return true;
 }
+
+char *file_in_same_dir(const char *path, const char *filename) {
+        char *e, *ret;
+        size_t k;
+
+        assert(path);
+        assert(filename);
+
+        /* This removes the last component of path and appends
+         * filename, unless the latter is absolute anyway or the
+         * former isn't */
+
+        if (path_is_absolute(filename))
+                return strdup(filename);
+
+        e = strrchr(path, '/');
+        if (!e)
+                return strdup(filename);
+
+        k = strlen(filename);
+        ret = new(char, (e + 1 - path) + k + 1);
+        if (!ret)
+                return NULL;
+
+        memcpy(mempcpy(ret, path, e + 1 - path), filename, k + 1);
+        return ret;
+}
+
+bool hidden_file_allow_backup(const char *filename) {
+        assert(filename);
+
+        return
+                filename[0] == '.' ||
+                streq(filename, "lost+found") ||
+                streq(filename, "aquota.user") ||
+                streq(filename, "aquota.group") ||
+                endswith(filename, ".rpmnew") ||
+                endswith(filename, ".rpmsave") ||
+                endswith(filename, ".rpmorig") ||
+                endswith(filename, ".dpkg-old") ||
+                endswith(filename, ".dpkg-new") ||
+                endswith(filename, ".dpkg-tmp") ||
+                endswith(filename, ".dpkg-dist") ||
+                endswith(filename, ".dpkg-bak") ||
+                endswith(filename, ".dpkg-backup") ||
+                endswith(filename, ".dpkg-remove") ||
+                endswith(filename, ".swp");
+}
+
+bool hidden_file(const char *filename) {
+        assert(filename);
+
+        if (endswith(filename, "~"))
+                return true;
+
+        return hidden_file_allow_backup(filename);
+}
+
+bool is_device_path(const char *path) {
+
+        /* Returns true on paths that refer to a device, either in
+         * sysfs or in /dev */
+
+        return
+                path_startswith(path, "/dev/") ||
+                path_startswith(path, "/sys/");
+}
index b2acca05fef291e062f3506488e3b7f6d41c62af..193bf72468d74133f42feddd52ebea4f08a690cc 100644 (file)
@@ -105,3 +105,10 @@ char* dirname_malloc(const char *path);
 
 bool filename_is_valid(const char *p) _pure_;
 bool path_is_safe(const char *p) _pure_;
+
+char *file_in_same_dir(const char *path, const char *filename);
+
+bool hidden_file_allow_backup(const char *filename);
+bool hidden_file(const char *filename) _pure_;
+
+bool is_device_path(const char *path);
index 121ca3376e8056e851c39736e25603b0420a7619..e214c6f3dc41aa59d4c1009076a39b16ffb66030 100644 (file)
 #include "utf8.h"
 #include "util.h"
 #include "virt.h"
+#include "dirent-util.h"
 
 /* Put this test here for a lack of better place */
 assert_cc(EAGAIN == EWOULDBLOCK);
@@ -247,33 +248,6 @@ int readlink_and_canonicalize(const char *p, char **r) {
         return 0;
 }
 
-char *file_in_same_dir(const char *path, const char *filename) {
-        char *e, *ret;
-        size_t k;
-
-        assert(path);
-        assert(filename);
-
-        /* This removes the last component of path and appends
-         * filename, unless the latter is absolute anyway or the
-         * former isn't */
-
-        if (path_is_absolute(filename))
-                return strdup(filename);
-
-        e = strrchr(path, '/');
-        if (!e)
-                return strdup(filename);
-
-        k = strlen(filename);
-        ret = new(char, (e + 1 - path) + k + 1);
-        if (!ret)
-                return NULL;
-
-        memcpy(mempcpy(ret, path, e + 1 - path), filename, k + 1);
-        return ret;
-}
-
 int rmdir_parents(const char *path, const char *stop) {
         size_t l;
         int r = 0;
@@ -320,36 +294,6 @@ int rmdir_parents(const char *path, const char *stop) {
         return 0;
 }
 
-_pure_ static bool hidden_file_allow_backup(const char *filename) {
-        assert(filename);
-
-        return
-                filename[0] == '.' ||
-                streq(filename, "lost+found") ||
-                streq(filename, "aquota.user") ||
-                streq(filename, "aquota.group") ||
-                endswith(filename, ".rpmnew") ||
-                endswith(filename, ".rpmsave") ||
-                endswith(filename, ".rpmorig") ||
-                endswith(filename, ".dpkg-old") ||
-                endswith(filename, ".dpkg-new") ||
-                endswith(filename, ".dpkg-tmp") ||
-                endswith(filename, ".dpkg-dist") ||
-                endswith(filename, ".dpkg-bak") ||
-                endswith(filename, ".dpkg-backup") ||
-                endswith(filename, ".dpkg-remove") ||
-                endswith(filename, ".swp");
-}
-
-bool hidden_file(const char *filename) {
-        assert(filename);
-
-        if (endswith(filename, "~"))
-                return true;
-
-        return hidden_file_allow_backup(filename);
-}
-
 bool fstype_is_network(const char *fstype) {
         static const char table[] =
                 "afs\0"
@@ -373,16 +317,6 @@ bool fstype_is_network(const char *fstype) {
         return nulstr_contains(table, fstype);
 }
 
-bool is_device_path(const char *path) {
-
-        /* Returns true on paths that refer to a device, either in
-         * sysfs or in /dev */
-
-        return
-                path_startswith(path, "/dev/") ||
-                path_startswith(path, "/sys/");
-}
-
 int dir_is_empty(const char *path) {
         _cleanup_closedir_ DIR *d;
         struct dirent *de;
@@ -615,34 +549,6 @@ int null_or_empty_fd(int fd) {
         return null_or_empty(&st);
 }
 
-bool dirent_is_file(const struct dirent *de) {
-        assert(de);
-
-        if (hidden_file(de->d_name))
-                return false;
-
-        if (de->d_type != DT_REG &&
-            de->d_type != DT_LNK &&
-            de->d_type != DT_UNKNOWN)
-                return false;
-
-        return true;
-}
-
-bool dirent_is_file_with_suffix(const struct dirent *de, const char *suffix) {
-        assert(de);
-
-        if (de->d_type != DT_REG &&
-            de->d_type != DT_LNK &&
-            de->d_type != DT_UNKNOWN)
-                return false;
-
-        if (hidden_file_allow_backup(de->d_name))
-                return false;
-
-        return endswith(de->d_name, suffix);
-}
-
 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;
@@ -950,31 +856,6 @@ int glob_extend(char ***strv, const char *path) {
         return k;
 }
 
-int dirent_ensure_type(DIR *d, struct dirent *de) {
-        struct stat st;
-
-        assert(d);
-        assert(de);
-
-        if (de->d_type != DT_UNKNOWN)
-                return 0;
-
-        if (fstatat(dirfd(d), de->d_name, &st, AT_SYMLINK_NOFOLLOW) < 0)
-                return -errno;
-
-        de->d_type =
-                S_ISREG(st.st_mode)  ? DT_REG  :
-                S_ISDIR(st.st_mode)  ? DT_DIR  :
-                S_ISLNK(st.st_mode)  ? DT_LNK  :
-                S_ISFIFO(st.st_mode) ? DT_FIFO :
-                S_ISSOCK(st.st_mode) ? DT_SOCK :
-                S_ISCHR(st.st_mode)  ? DT_CHR  :
-                S_ISBLK(st.st_mode)  ? DT_BLK  :
-                                       DT_UNKNOWN;
-
-        return 0;
-}
-
 int get_files_in_directory(const char *path, char ***list) {
         _cleanup_closedir_ DIR *d = NULL;
         size_t bufsize = 0, n = 0;
index 6e5df014501b397d8af77879311ef56cf6cc7a0f..190d4f5edbe5d00b34ddacff7ee5c6d27f4152d1 100644 (file)
@@ -22,7 +22,6 @@
 ***/
 
 #include <alloca.h>
-#include <dirent.h>
 #include <fcntl.h>
 #include <inttypes.h>
 #include <limits.h>
@@ -90,15 +89,8 @@ int readlink_value(const char *p, char **ret);
 int readlink_and_make_absolute(const char *p, char **r);
 int readlink_and_canonicalize(const char *p, char **r);
 
-char *file_in_same_dir(const char *path, const char *filename);
-
 int rmdir_parents(const char *path, const char *stop);
 
-bool dirent_is_file(const struct dirent *de) _pure_;
-bool dirent_is_file_with_suffix(const struct dirent *de, const char *suffix) _pure_;
-
-bool hidden_file(const char *filename) _pure_;
-
 /* For basic lookup tables with strictly enumerated entries */
 #define _DEFINE_STRING_TABLE_LOOKUP_TO_STRING(name,type,scope)          \
         scope const char *name##_to_string(type i) {                    \
@@ -157,8 +149,6 @@ ssize_t string_table_lookup(const char * const *table, size_t len, const char *k
 
 bool fstype_is_network(const char *fstype);
 
-bool is_device_path(const char *path);
-
 int dir_is_empty(const char *path);
 
 static inline int dir_is_populated(const char *path) {
@@ -216,8 +206,6 @@ int socket_from_display(const char *display, char **path);
 int glob_exists(const char *path);
 int glob_extend(char ***strv, const char *path);
 
-int dirent_ensure_type(DIR *d, struct dirent *de);
-
 int get_files_in_directory(const char *path, char ***list);
 
 bool is_main_thread(void);
@@ -332,26 +320,6 @@ const char *draw_special_char(DrawSpecialChar ch);
 
 int on_ac_power(void);
 
-#define FOREACH_DIRENT(de, d, on_error)                                 \
-        for (errno = 0, de = readdir(d);; errno = 0, de = readdir(d))   \
-                if (!de) {                                              \
-                        if (errno > 0) {                                \
-                                on_error;                               \
-                        }                                               \
-                        break;                                          \
-                } else if (hidden_file((de)->d_name))                   \
-                        continue;                                       \
-                else
-
-#define FOREACH_DIRENT_ALL(de, d, on_error)                             \
-        for (errno = 0, de = readdir(d);; errno = 0, de = readdir(d))   \
-                if (!de) {                                              \
-                        if (errno > 0) {                                \
-                                on_error;                               \
-                        }                                               \
-                        break;                                          \
-                } else
-
 static inline void *mempset(void *s, int c, size_t n) {
         memset(s, c, n);
         return (uint8_t*)s + n;
index 50b69637ef4af466693b3e8f7432867698a688ca..e488c94b3b9137073f26403bf68698b91959ba81 100644 (file)
@@ -33,6 +33,7 @@
 
 #include "bootchart.h"
 #include "cgroup-util.h"
+#include "dirent-util.h"
 #include "fd-util.h"
 #include "fileio.h"
 #include "parse-util.h"
index 34df3921849d14b563fbc0c22e22aebbc54e4320..b8cb9964a6a18cdac1e3351bb9f87d7fb9f909d1 100644 (file)
@@ -28,6 +28,7 @@
 #include <stdlib.h>
 #include <string.h>
 
+#include "dirent-util.h"
 #include "fd-util.h"
 #include "fileio.h"
 #include "log.h"
index b9683a7ee19e5a2ac7b5bc7266f06d15a9f3273a..66a0fe9ea229345967cea9f78ff8d8cbfb936cc0 100644 (file)
@@ -23,6 +23,7 @@
 #include "bus-util.h"
 #include "cgroup-util.h"
 #include "conf-parser.h"
+#include "dirent-util.h"
 #include "fd-util.h"
 #include "fileio.h"
 #include "mkdir.h"
index bb2e6195b98f9c5ff3f6ab61eac72b438b388735..590ab865152f2be4a124a2de991c0e9c33a9bd47 100644 (file)
@@ -26,6 +26,7 @@
 #include <sys/prctl.h>
 #include <unistd.h>
 
+#include "dirent-util.h"
 #include "fd-util.h"
 #include "hashmap.h"
 #include "log.h"
index 6440fd654e0caa0e45b6770ae16b65c8f91c3a6b..f315d5ff6ec8ffe56d921817e7ea2e1affe9bede 100644 (file)
@@ -29,6 +29,7 @@
 
 #include "blkid-util.h"
 #include "btrfs-util.h"
+#include "dirent-util.h"
 #include "efivars.h"
 #include "fd-util.h"
 #include "fileio.h"
index 0e918d6416273ea225b80190b0829c6c326270db..17283a4a24fcfc7ba09b0ebd952748c8130a417a 100644 (file)
@@ -24,6 +24,7 @@
 #include "btrfs-util.h"
 #include "capability.h"
 #include "copy.h"
+#include "dirent-util.h"
 #include "escape.h"
 #include "fd-util.h"
 #include "io-util.h"
index bad6ea424260abca503015ef425dcc0ea4a27cd3..9635db19e19a2f2b278444843f67182cf0966a5d 100644 (file)
@@ -22,6 +22,7 @@
 #include <sys/statvfs.h>
 
 #include "coredump-vacuum.h"
+#include "dirent-util.h"
 #include "fd-util.h"
 #include "hashmap.h"
 #include "macro.h"
index 92f598464a3b86c009fda84793d12d15cd9f7aae..ec57920d2e05667e8fb2f773d7e462a3cdaf36f1 100644 (file)
@@ -40,6 +40,7 @@
 #include "conf-parser.h"
 #include "copy.h"
 #include "coredump-vacuum.h"
+#include "dirent-util.h"
 #include "escape.h"
 #include "fd-util.h"
 #include "fileio.h"
index 026dca49012590de441cb4de752582032110e8c0..d3add065d27dd3a74eebaa6b60122c1911562632 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "sd-id128.h"
 
+#include "dirent-util.h"
 #include "fd-util.h"
 #include "journal-def.h"
 #include "journal-file.h"
index f286e3030f77b7df1f8fc382ce338fbd7abb7f3a..6e6d9c1c4ac35a72616f7949eec4bf8de25f1ffb 100644 (file)
@@ -36,6 +36,7 @@
 #include "acl-util.h"
 #include "cgroup-util.h"
 #include "conf-parser.h"
+#include "dirent-util.h"
 #include "extract-word.h"
 #include "fd-util.h"
 #include "formats-util.h"
index 6745864da11a0080100ab5046d16dfd557422896..a9c940690f7145600a6e98681393ac91d5cb8c60 100644 (file)
@@ -29,6 +29,7 @@
 #include "sd-daemon.h"
 #include "sd-event.h"
 
+#include "dirent-util.h"
 #include "escape.h"
 #include "fd-util.h"
 #include "fileio.h"
index 9dcfc726eaeb0cdf5f09275a9111b42ed16362a2..cfe1623e5bdb332a2762d5cd13f4949bfe7b494b 100644 (file)
@@ -32,6 +32,7 @@
 
 #include "catalog.h"
 #include "compress.h"
+#include "dirent-util.h"
 #include "fd-util.h"
 #include "fileio.h"
 #include "formats-util.h"
index c98053220c55297a750c0c1a9d5c33b8138d967e..e1eb5b26b3a755d953f424f537a1232133952165 100644 (file)
@@ -22,6 +22,7 @@
 
 #include "device-enumerator-private.h"
 #include "device-util.h"
+#include "dirent-util.h"
 #include "fd-util.h"
 #include "prioq.h"
 #include "set.h"
index 879838601c2716f3ba04995d16abd14cfd1470e2..90ee26307987e6eaff3dc78c20899a4ffdecd689 100644 (file)
@@ -43,6 +43,7 @@
 #include "strv.h"
 #include "user-util.h"
 #include "util.h"
+#include "dirent-util.h"
 
 /* Error codes:
  *
index 4d7bda3ee015407dde1241699c9ae780aeb6db5b..acb2bd57653beac7493328387ed97a35be4eddcb 100644 (file)
@@ -23,6 +23,7 @@
 #include <string.h>
 
 #include "acl-util.h"
+#include "dirent-util.h"
 #include "escape.h"
 #include "fd-util.h"
 #include "formats-util.h"
index 61c2c9ba409145cb5771d1de4ddf9a69bef9cd6c..2fcf4900d3c2eb1223a9d515dbcf67f1b78333ca 100644 (file)
@@ -30,6 +30,7 @@
 #include "bus-common-errors.h"
 #include "bus-error.h"
 #include "bus-util.h"
+#include "dirent-util.h"
 #include "efivars.h"
 #include "escape.h"
 #include "fd-util.h"
index 02c87ca58ed5fc50d9769b1b68c47119fba11be0..957ea1fd7eddd77abf1c8ed9d8402b5138f99df2 100644 (file)
@@ -30,6 +30,7 @@
 #include "bus-error.h"
 #include "bus-util.h"
 #include "conf-parser.h"
+#include "dirent-util.h"
 #include "fd-util.h"
 #include "formats-util.h"
 #include "logind.h"
index fe229c88a8c8f039a51b53b61628952336c86e0f..1a61da041d2466879383141a02b9cf3856adf29e 100644 (file)
@@ -28,6 +28,7 @@
 #include "bus-error.h"
 #include "bus-util.h"
 #include "cgroup-util.h"
+#include "dirent-util.h"
 #include "fd-util.h"
 #include "formats-util.h"
 #include "hostname-util.h"
index 2be1bc3fc0b3b829a182edb043db5dcbee30cd63..c60f60599778886850c967eb05082c6b3daf96fd 100644 (file)
@@ -35,6 +35,7 @@
 #include "string-util.h"
 #include "strv.h"
 #include "util.h"
+#include "dirent-util.h"
 
 static int clean_sysvipc_shm(uid_t delete_uid) {
         _cleanup_fclose_ FILE *f = NULL;
index 771bc9458c65e7b5c64114049bae84bd599336af..6e8f156a688b3ae3804f16fb20fb577115aeea69 100644 (file)
@@ -23,6 +23,7 @@
 #include <string.h>
 #include <fcntl.h>
 
+#include "dirent-util.h"
 #include "efivars.h"
 #include "fd-util.h"
 #include "io-util.h"
index a1720488e8d3c1411b81426585cd4ded47b6f4e7..bfafb59008e30a45a050a3e700fbd14e4539eeac 100644 (file)
 
 #include "conf-files.h"
 #include "conf-parser.h"
+#include "dirent-util.h"
+#include "fd-util.h"
 #include "hashmap.h"
 #include "install-printf.h"
+#include "install.h"
 #include "mkdir.h"
 #include "path-lookup.h"
 #include "path-util.h"
@@ -38,8 +41,6 @@
 #include "strv.h"
 #include "unit-name.h"
 #include "util.h"
-#include "install.h"
-#include "fd-util.h"
 
 typedef struct {
         OrderedHashmap *will_install;
index 415d939fc65e7a480c555c6ebe53ef4a93599de7..485793ed5d7fe458e742ae6a7495e437c63b3cd2 100644 (file)
@@ -25,6 +25,7 @@
 
 #include "btrfs-util.h"
 #include "copy.h"
+#include "dirent-util.h"
 #include "fd-util.h"
 #include "machine-image.h"
 #include "mkdir.h"
index af8d478fa9e1e3385c4c3c2cf1b0042e9430ce51..104f6327be581faa4f14a70336d5ae142742cb0d 100644 (file)
@@ -20,6 +20,7 @@
 ***/
 
 #include "cgroup-util.h"
+#include "dirent-util.h"
 #include "fd-util.h"
 #include "formats-util.h"
 #include "parse-util.h"
index 33419f696263c08d70828274ad56c21e1b99a8d6..a6240ae89a55e4cbd8617f31ffce9d7b833e1977 100644 (file)
@@ -35,6 +35,7 @@
 #include "ask-password-api.h"
 #include "conf-parser.h"
 #include "def.h"
+#include "dirent-util.h"
 #include "fd-util.h"
 #include "io-util.h"
 #include "mkdir.h"