summaryrefslogtreecommitdiffstats
path: root/src/shared
diff options
context:
space:
mode:
authorYu Watanabe <watanabe.yu+github@gmail.com>2021-06-23 21:29:40 +0200
committerYu Watanabe <watanabe.yu+github@gmail.com>2021-06-23 21:29:40 +0200
commitf565b8676fbdab115c068a57952f53a88e50f849 (patch)
tree394358410989faad9a9b640086e7df3e51954786 /src/shared
parentdirent-util: introduce readdir_ensure_type() (diff)
downloadsystemd-f565b8676fbdab115c068a57952f53a88e50f849.tar.xz
systemd-f565b8676fbdab115c068a57952f53a88e50f849.zip
dirent-util: use readdir_ensure_type() in readdir_no_dot() and FOREACH_DIRENT()
Diffstat (limited to 'src/shared')
-rw-r--r--src/shared/bootspec.c1
-rw-r--r--src/shared/install.c10
-rw-r--r--src/shared/numa-util.c2
3 files changed, 0 insertions, 13 deletions
diff --git a/src/shared/bootspec.c b/src/shared/bootspec.c
index dc334cf196..e538e2bd87 100644
--- a/src/shared/bootspec.c
+++ b/src/shared/bootspec.c
@@ -482,7 +482,6 @@ static int boot_entries_find_unified(
_cleanup_free_ char *j = NULL, *osrelease = NULL, *cmdline = NULL;
_cleanup_close_ int fd = -1;
- dirent_ensure_type(d, de);
if (!dirent_is_file(de))
continue;
diff --git a/src/shared/install.c b/src/shared/install.c
index ba4fa5b136..5a1427ee02 100644
--- a/src/shared/install.c
+++ b/src/shared/install.c
@@ -568,8 +568,6 @@ static int remove_marked_symlinks_fd(
FOREACH_DIRENT(de, d, return -errno) {
- dirent_ensure_type(d, de);
-
if (de->d_type == DT_DIR) {
_cleanup_free_ char *p = NULL;
int nfd, q;
@@ -738,8 +736,6 @@ static int find_symlinks_in_directory(
bool found_path = false, found_dest, b = false;
int q;
- dirent_ensure_type(dir, de);
-
if (de->d_type != DT_LNK)
continue;
@@ -836,8 +832,6 @@ static int find_symlinks(
_cleanup_free_ const char *path = NULL;
_cleanup_closedir_ DIR *d = NULL;
- dirent_ensure_type(config_dir, de);
-
if (de->d_type != DT_DIR)
continue;
@@ -3379,8 +3373,6 @@ int unit_file_preset_all(
if (!unit_name_is_valid(de->d_name, UNIT_NAME_ANY))
continue;
- dirent_ensure_type(d, de);
-
if (!IN_SET(de->d_type, DT_LNK, DT_REG))
continue;
@@ -3457,8 +3449,6 @@ int unit_file_get_list(
if (hashmap_get(h, de->d_name))
continue;
- dirent_ensure_type(d, de);
-
if (!IN_SET(de->d_type, DT_LNK, DT_REG))
continue;
diff --git a/src/shared/numa-util.c b/src/shared/numa-util.c
index 7e41d68662..644b0bde5b 100644
--- a/src/shared/numa-util.c
+++ b/src/shared/numa-util.c
@@ -139,8 +139,6 @@ static int numa_max_node(void) {
int node;
const char *n;
- (void) dirent_ensure_type(d, de);
-
if (de->d_type != DT_DIR)
continue;