summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/config.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/src/config.c b/src/config.c
index 8a417e9..672c0a7 100644
--- a/src/config.c
+++ b/src/config.c
@@ -324,17 +324,15 @@ static void read_peer_dir(fastd_context_t *ctx, fastd_config_t *conf, const char
if (dirh) {
while (true) {
- struct dirent entry, *result;
- int ret;
+ errno = 0;
+ struct dirent *result = readdir(dirh);
+ if (!result) {
+ if (errno)
+ pr_error_errno(ctx, "readdir");
- ret = readdir_r(dirh, &entry, &result);
- if (ret) {
- pr_error(ctx, "readdir_r: %s", strerror(ret));
break;
}
- if (!result)
- break;
if (result->d_name[0] == '.')
continue;