diff options
Diffstat (limited to 'src/delta/delta.c')
-rw-r--r-- | src/delta/delta.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/delta/delta.c b/src/delta/delta.c index 107b105fde..9a44b15da7 100644 --- a/src/delta/delta.c +++ b/src/delta/delta.c @@ -297,6 +297,7 @@ static int enumerate_dir_d(Hashmap *top, Hashmap *bottom, Hashmap *drops, const static int enumerate_dir(Hashmap *top, Hashmap *bottom, Hashmap *drops, const char *path, bool dropins) { _cleanup_closedir_ DIR *d; + struct dirent *de; assert(top); assert(bottom); @@ -313,16 +314,10 @@ static int enumerate_dir(Hashmap *top, Hashmap *bottom, Hashmap *drops, const ch return log_error_errno(errno, "Failed to open %s: %m", path); } - for (;;) { - struct dirent *de; + FOREACH_DIRENT_ALL(de, d, return -errno) { int k; char *p; - errno = 0; - de = readdir(d); - if (!de) - return -errno; - dirent_ensure_type(d, de); if (dropins && de->d_type == DT_DIR && endswith(de->d_name, ".d")) @@ -354,6 +349,7 @@ static int enumerate_dir(Hashmap *top, Hashmap *bottom, Hashmap *drops, const ch return k; } } + return 0; } static int should_skip_prefix(const char* p) { |