ftw(): 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. POSIX does have a requirement on the application that maxfds not exceed {OPEN_MAX}, but does not require the implementation to check it ("may fail"). PR: 95239
This commit is contained in:
parent
4d767dfea4
commit
47875b0caa
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=239151
@ -28,7 +28,6 @@ __FBSDID("$FreeBSD$");
|
||||
#include <errno.h>
|
||||
#include <fts.h>
|
||||
#include <ftw.h>
|
||||
#include <limits.h>
|
||||
|
||||
int
|
||||
ftw(const char *path, int (*fn)(const char *, const struct stat *, int),
|
||||
@ -40,7 +39,7 @@ ftw(const char *path, int (*fn)(const char *, const struct stat *, int),
|
||||
int error = 0, fnflag, sverrno;
|
||||
|
||||
/* XXX - nfds is currently unused */
|
||||
if (nfds < 1 || nfds > OPEN_MAX) {
|
||||
if (nfds < 1) {
|
||||
errno = EINVAL;
|
||||
return (-1);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user