summaryrefslogtreecommitdiff
path: root/source3/param/loadparm.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2009-12-02 10:01:14 -0800
committerJeremy Allison <jra@samba.org>2009-12-02 10:01:14 -0800
commitb6fdecd11210a3d2ff803bdc315aacd9f8b445a1 (patch)
treef182933a4e5e381d402a1a266d980d0182e58d58 /source3/param/loadparm.c
parent5f60855ba2eb822dcb867378ff09278c42931b89 (diff)
downloadsamba-b6fdecd11210a3d2ff803bdc315aacd9f8b445a1.tar.gz
samba-b6fdecd11210a3d2ff803bdc315aacd9f8b445a1.tar.bz2
samba-b6fdecd11210a3d2ff803bdc315aacd9f8b445a1.zip
Fix bug #6837 - "Too many open files" when trying to access large number of files
from Windows 7. Original patch by me fixed up with the correct open files number by jmaggard10@hotmail.com. Jeremy.
Diffstat (limited to 'source3/param/loadparm.c')
-rw-r--r--source3/param/loadparm.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/source3/param/loadparm.c b/source3/param/loadparm.c
index a1f5328763..3d426ecf3b 100644
--- a/source3/param/loadparm.c
+++ b/source3/param/loadparm.c
@@ -4739,6 +4739,22 @@ static int max_open_files(void)
#endif
#endif
+ if (sysctl_max < MIN_OPEN_FILES_WINDOWS) {
+ DEBUG(2,("max_open_files: sysctl_max (%d) below "
+ "minimum Windows limit (%d)\n",
+ sysctl_max,
+ MIN_OPEN_FILES_WINDOWS));
+ sysctl_max = MIN_OPEN_FILES_WINDOWS;
+ }
+
+ if (rlimit_max < MIN_OPEN_FILES_WINDOWS) {
+ DEBUG(2,("rlimit_max: rlimit_max (%d) below "
+ "minimum Windows limit (%d)\n",
+ rlimit_max,
+ MIN_OPEN_FILES_WINDOWS));
+ rlimit_max = MIN_OPEN_FILES_WINDOWS;
+ }
+
return MIN(sysctl_max, rlimit_max);
}