1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-20 11:11:24 +00:00

nftw(): Do not check the maxfds argument against OPEN_MAX.

Apart from the fact that nothing should have OPEN_MAX as a limit (as opposed
to RLIMIT_NOFILE from getrlimit() or _SC_OPEN_MAX from sysconf()), POSIX
does not require us to check this.

PR:		95239
Submitted by:	Todd Miller
This commit is contained in:
Jilles Tjoelker 2012-08-09 15:04:06 +00:00
parent 2f70fca5ec
commit 4d767dfea4
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=239150

View File

@ -34,7 +34,6 @@ __FBSDID("$FreeBSD$");
#include <errno.h>
#include <fts.h>
#include <ftw.h>
#include <limits.h>
int
nftw(const char *path, int (*fn)(const char *, const struct stat *, int,
@ -47,7 +46,7 @@ nftw(const char *path, int (*fn)(const char *, const struct stat *, int,
int error = 0, ftsflags, fnflag, postorder, sverrno;
/* XXX - nfds is currently unused */
if (nfds < 1 || nfds > OPEN_MAX) {
if (nfds < 1) {
errno = EINVAL;
return (-1);
}