summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/shared/conf-files.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/shared/conf-files.c b/src/shared/conf-files.c
index 92204a6a09..c86bb03074 100644
--- a/src/shared/conf-files.c
+++ b/src/shared/conf-files.c
@@ -53,13 +53,13 @@ static int files_add(Hashmap *h, const char *root, const char *path, const char
for (;;) {
struct dirent *de;
- union dirent_storage buf;
char *p;
int r;
- r = readdir_r(dir, &buf.de, &de);
- if (r != 0)
- return -r;
+ errno = 0;
+ de = readdir(dir);
+ if (!de && errno != 0)
+ return -errno;
if (!de)
break;