aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2008-02-10 15:19:08 +0000
committerCorinna Vinschen <corinna@vinschen.de>2008-02-10 15:19:08 +0000
commitbebb25961c1ed29d217b1a40fc69c77ebdc18bcd (patch)
tree8fabc27cfd0345a4e1c6be80c9f10a003695f8ad
parent30bd87b827edf86dec0df4174ed7e4e5be0ecaf8 (diff)
downloadnewlib-bebb25961c1ed29d217b1a40fc69c77ebdc18bcd.zip
newlib-bebb25961c1ed29d217b1a40fc69c77ebdc18bcd.tar.gz
newlib-bebb25961c1ed29d217b1a40fc69c77ebdc18bcd.tar.bz2
* libc/ftw.cc (ftw): Allow nfds < 0 for glibc compatibility.
* libc/nftw.c (nftw): Ditto.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/libc/ftw.c5
-rw-r--r--winsup/cygwin/libc/nftw.c5
3 files changed, 15 insertions, 0 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 0bc7701..e1d6a10 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+2008-02-10 Corinna Vinschen <corinna@vinschen.de>
+
+ * libc/ftw.cc (ftw): Allow nfds < 0 for glibc compatibility.
+ * libc/nftw.c (nftw): Ditto.
+
2008-02-07 Corinna Vinschen <corinna@vinschen.de>
* dtable.cc (dtable::init_std_file_from_handle): Set access to
diff --git a/winsup/cygwin/libc/ftw.c b/winsup/cygwin/libc/ftw.c
index 2589e5b..9863e16 100644
--- a/winsup/cygwin/libc/ftw.c
+++ b/winsup/cygwin/libc/ftw.c
@@ -49,11 +49,16 @@ ftw(const char *path, int (*fn)(const char *, const struct __stat64 *, int),
FTS *ftsp;
int error = 0, fnflag, sverrno;
+#if 0
+ /* GLibc allows nfds < 1 and treats it as nfds == 1. Since nfds is
+ not used in this OpenBSD version anyway, just ignore it for
+ Linux compatibility. */
/* XXX - nfds is currently unused */
if (nfds < 1 || nfds > OPEN_MAX) {
errno = EINVAL;
return (-1);
}
+#endif
ftsp = fts_open(paths, FTS_LOGICAL | FTS_COMFOLLOW | FTS_NOCHDIR, NULL);
if (ftsp == NULL)
diff --git a/winsup/cygwin/libc/nftw.c b/winsup/cygwin/libc/nftw.c
index f7c06b2..bb1c923 100644
--- a/winsup/cygwin/libc/nftw.c
+++ b/winsup/cygwin/libc/nftw.c
@@ -50,11 +50,16 @@ nftw(const char *path, int (*fn)(const char *, const struct __stat64 *, int,
FTS *ftsp;
int error = 0, ftsflags, fnflag, postorder, sverrno;
+#if 0
+ /* GLibc allows nfds < 1 and treats it as nfds == 1. Since nfds is
+ not used in this OpenBSD version anyway, just ignore it for
+ Linux compatibility. */
/* XXX - nfds is currently unused */
if (nfds < 1 || nfds > OPEN_MAX) {
errno = EINVAL;
return (-1);
}
+#endif
ftsflags = FTS_COMFOLLOW;
if (!(ftwflags & FTW_CHDIR))