diff options
author | jilles <jilles@FreeBSD.org> | 2012-08-09 15:11:38 +0000 |
---|---|---|
committer | jilles <jilles@FreeBSD.org> | 2012-08-09 15:11:38 +0000 |
commit | 01c6b906beb3f49fe7d799ffaa172f7b9d686595 (patch) | |
tree | 933955f7e71757dadd941575ec8621686a6854d1 /lib/libc | |
parent | 05000e5bd1001071522b669bef4e6844d1453f80 (diff) | |
download | FreeBSD-src-01c6b906beb3f49fe7d799ffaa172f7b9d686595.zip FreeBSD-src-01c6b906beb3f49fe7d799ffaa172f7b9d686595.tar.gz |
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
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/gen/ftw.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libc/gen/ftw.c b/lib/libc/gen/ftw.c index bfaf121..253a295 100644 --- a/lib/libc/gen/ftw.c +++ b/lib/libc/gen/ftw.c @@ -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); } |