Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 17 Dec 2012 13:03:13 +0000 (UTC)
From:      Jilles Tjoelker <jilles@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-9@freebsd.org
Subject:   svn commit: r244359 - stable/9/lib/libc/gen
Message-ID:  <201212171303.qBHD3D0X090771@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jilles
Date: Mon Dec 17 13:03:13 2012
New Revision: 244359
URL: http://svnweb.freebsd.org/changeset/base/244359

Log:
  MFC r239151: 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

Modified:
  stable/9/lib/libc/gen/ftw.c
Directory Properties:
  stable/9/lib/libc/   (props changed)

Modified: stable/9/lib/libc/gen/ftw.c
==============================================================================
--- stable/9/lib/libc/gen/ftw.c	Mon Dec 17 12:57:36 2012	(r244358)
+++ stable/9/lib/libc/gen/ftw.c	Mon Dec 17 13:03:13 2012	(r244359)
@@ -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 ch
 	int error = 0, fnflag, sverrno;
 
 	/* XXX - nfds is currently unused */
-	if (nfds < 1 || nfds > OPEN_MAX) {
+	if (nfds < 1) {
 		errno = EINVAL;
 		return (-1);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201212171303.qBHD3D0X090771>