diff options
author | Reverend Homer <mk.43.ecko@gmail.com> | 2016-12-09 12:04:30 +0300 |
---|---|---|
committer | Martin Pitt <martin.pitt@ubuntu.com> | 2016-12-09 10:04:30 +0100 |
commit | 8fb3f0099787a5b48213c4e2aa42d8ff61b0c7f1 (patch) | |
tree | c9bf990e18daac08ec1e744d6be365a9e98d2532 /src/basic/fd-util.c | |
parent | 9258a1cae3985ee590f1c698451bd7909aa38d2b (diff) | |
download | systemd-8fb3f0099787a5b48213c4e2aa42d8ff61b0c7f1.tar.gz |
tree-wide: replace all readdir cycles with FOREACH_DIRENT{,_ALL} (#4853)
Diffstat (limited to 'src/basic/fd-util.c')
-rw-r--r-- | src/basic/fd-util.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/basic/fd-util.c b/src/basic/fd-util.c index 5c820332a5..19ad20789b 100644 --- a/src/basic/fd-util.c +++ b/src/basic/fd-util.c @@ -24,6 +24,7 @@ #include <sys/stat.h> #include <unistd.h> +#include "dirent-util.h" #include "fd-util.h" #include "fs-util.h" #include "macro.h" @@ -234,12 +235,9 @@ int close_all_fds(const int except[], unsigned n_except) { return r; } - while ((de = readdir(d))) { + FOREACH_DIRENT(de, d, return -errno) { int fd = -1; - if (hidden_or_backup_file(de->d_name)) - continue; - if (safe_atoi(de->d_name, &fd) < 0) /* Let's better ignore this, just in case */ continue; |