* libc/ftw.cc (ftw): Allow nfds < 0 for glibc compatibility.
* libc/nftw.c (nftw): Ditto.
This commit is contained in:
parent
30bd87b827
commit
bebb25961c
@ -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>
|
2008-02-07 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* dtable.cc (dtable::init_std_file_from_handle): Set access to
|
* dtable.cc (dtable::init_std_file_from_handle): Set access to
|
||||||
|
@ -49,11 +49,16 @@ ftw(const char *path, int (*fn)(const char *, const struct __stat64 *, int),
|
|||||||
FTS *ftsp;
|
FTS *ftsp;
|
||||||
int error = 0, fnflag, sverrno;
|
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 */
|
/* XXX - nfds is currently unused */
|
||||||
if (nfds < 1 || nfds > OPEN_MAX) {
|
if (nfds < 1 || nfds > OPEN_MAX) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
ftsp = fts_open(paths, FTS_LOGICAL | FTS_COMFOLLOW | FTS_NOCHDIR, NULL);
|
ftsp = fts_open(paths, FTS_LOGICAL | FTS_COMFOLLOW | FTS_NOCHDIR, NULL);
|
||||||
if (ftsp == NULL)
|
if (ftsp == NULL)
|
||||||
|
@ -50,11 +50,16 @@ nftw(const char *path, int (*fn)(const char *, const struct __stat64 *, int,
|
|||||||
FTS *ftsp;
|
FTS *ftsp;
|
||||||
int error = 0, ftsflags, fnflag, postorder, sverrno;
|
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 */
|
/* XXX - nfds is currently unused */
|
||||||
if (nfds < 1 || nfds > OPEN_MAX) {
|
if (nfds < 1 || nfds > OPEN_MAX) {
|
||||||
errno = EINVAL;
|
errno = EINVAL;
|
||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
ftsflags = FTS_COMFOLLOW;
|
ftsflags = FTS_COMFOLLOW;
|
||||||
if (!(ftwflags & FTW_CHDIR))
|
if (!(ftwflags & FTW_CHDIR))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user