From b6fdecd11210a3d2ff803bdc315aacd9f8b445a1 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Wed, 2 Dec 2009 10:01:14 -0800 Subject: 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. --- source3/param/loadparm.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'source3/param/loadparm.c') 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); } -- cgit