[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 18/21] Workaround for dirfd() on OS/2 kLIBC
From: |
KO Myung-Hun |
Subject: |
[PATCH 18/21] Workaround for dirfd() on OS/2 kLIBC |
Date: |
Sun, 30 Nov 2014 13:20:20 +0900 |
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
- [PATCH 10/21] binary-io: put fd in binary mode if it is not a console on EMX, (continued)
- [PATCH 10/21] binary-io: put fd in binary mode if it is not a console on EMX, KO Myung-Hun, 2014/11/30
- [PATCH 11/21] pipe-filter-aux: undefine HAVE_SELECT on KLIBC, KO Myung-Hun, 2014/11/30
- [PATCH 14/21] getdtablesize: do not use getrlimit() on OS/2 kLIBC, KO Myung-Hun, 2014/11/30
- [PATCH 13/21] w32spawn: clear SHELL_SPECIAL_CHARS and SHELL_SPACE_CHAR on OS/2 kLIBC, KO Myung-Hun, 2014/11/30
- [PATCH 16/21] wcwidth: fix 'conflicting types' error for `__wcwidth' on OS/2 kLIBC, KO Myung-Hun, 2014/11/30
- [PATCH 18/21] Workaround for dirfd() on OS/2 kLIBC,
KO Myung-Hun <=
- [PATCH 15/21] freopen: workaround freopen() on OS/2 kLIBC, KO Myung-Hun, 2014/11/30
- [PATCH 17/21] Workaround for D_INO_IN_DIRENT on OS/2 kLIBC, KO Myung-Hun, 2014/11/30
- [PATCH 20/21] fdopendir: port to OS/2 kLIBC, KO Myung-Hun, 2014/11/30
- [PATCH 21/21] bootstrap: fix 'find: missing argument to `-exec'', KO Myung-Hun, 2014/11/30