commit 37133b80c7f51d61f19db807e7096e636d753315
Author: Raniconduh <clagv.ramdomgames@gmail.com>
Date: Fri Jan 02 00:47:13 2026 +0000
diff --git a/src/dir.c b/src/dir.c
index 650c307..ba04bf8 100644
--- a/src/dir.c
+++ b/src/dir.c
@@ -4927 +4927 @@ static int dir_internal_ftw(
) {
DIR * d = opendir(path);
if (!d) return -1;
- int ret = dir_internal_ftw_(dirfd(d), cb, arg);
+ int ret = dir_internal_ftw_(dup(dirfd(d)), cb, arg);
closedir(d);
return ret;
}