diff options
author | jilles <jilles@FreeBSD.org> | 2012-08-09 15:04:06 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2012-08-09 15:04:06 +0000 |
commit | 05000e5bd1001071522b669bef4e6844d1453f80 (patch) | |
tree | 121bee17924aeb2475d917588207ef9bd522c9fc /lib/libc | |
parent | 310fb71c7ee84d624c38ecd96afdf8bce5c3d044 (diff) | |
download | FreeBSD-src-05000e5bd1001071522b669bef4e6844d1453f80.zip FreeBSD-src-05000e5bd1001071522b669bef4e6844d1453f80.tar.gz |
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
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/nftw.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libc/gen/nftw.c b/lib/libc/gen/nftw.c index 43110c1..e14d09e 100644 --- a/lib/libc/gen/nftw.c +++ b/lib/libc/gen/nftw.c @@ -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); } |