dirfd() always return -2 on OS/2 kLIBC 0.6. This will be fixed in 0.7.
* lib/fts.c (fts_build): Do not check dir_fd on OS/2 kLIBC.
Patches from coreutils 8.8 by Paul Smedley.
---
lib/fts.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/lib/fts.c b/lib/fts.c
index 7f3cdc7..02ebdde 100644
--- a/lib/fts.c
+++ b/lib/fts.c
@@ -1403,7 +1403,11 @@ fts_build (register FTS *sp, int type)
if (0 <= dir_fd)
set_cloexec_flag (dir_fd, true);
}
+#ifdef __KLIBC__ /* will be fixed in libc 0.7 */
+ if (fts_safe_changedir(sp, cur, dir_fd, cur->fts_accpath)) {
+#else
if (dir_fd < 0 || fts_safe_changedir(sp, cur, dir_fd, NULL)) {
+#endif
if (nlinks && type == BREAD)
cur->fts_errno = errno;
cur->fts_flags |= FTS_DONTCHDIR;
--
1.8.5.2