tree-wide: replace all readdir cycles with FOREACH_DIRENT{,_ALL} (#4853)
This commit is contained in:
committed by
Martin Pitt
parent
9258a1cae3
commit
8fb3f00997
+2
-5
@@ -18,13 +18,13 @@
|
||||
***/
|
||||
|
||||
#include <alloca.h>
|
||||
#include <dirent.h>
|
||||
#include <errno.h>
|
||||
#include <fcntl.h>
|
||||
#include <stddef.h>
|
||||
|
||||
#include "sd-daemon.h"
|
||||
|
||||
#include "dirent-util.h"
|
||||
#include "fd-util.h"
|
||||
#include "fdset.h"
|
||||
#include "log.h"
|
||||
@@ -148,12 +148,9 @@ int fdset_new_fill(FDSet **_s) {
|
||||
goto finish;
|
||||
}
|
||||
|
||||
while ((de = readdir(d))) {
|
||||
FOREACH_DIRENT(de, d, return -errno) {
|
||||
int fd = -1;
|
||||
|
||||
if (hidden_or_backup_file(de->d_name))
|
||||
continue;
|
||||
|
||||
r = safe_atoi(de->d_name, &fd);
|
||||
if (r < 0)
|
||||
goto finish;
|
||||
|
||||
Reference in New Issue
Block a user