From 05000e5bd1001071522b669bef4e6844d1453f80 Mon Sep 17 00:00:00 2001
From: jilles <jilles@FreeBSD.org>
Date: Thu, 9 Aug 2012 15:04:06 +0000
Subject: 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
---
 lib/libc/gen/nftw.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

(limited to 'lib')

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);
 	}
-- 
cgit v1.1