diff options
author | Jeremy Allison <jra@samba.org> | 2009-12-02 10:01:14 -0800 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2009-12-02 10:01:14 -0800 |
commit | b6fdecd11210a3d2ff803bdc315aacd9f8b445a1 (patch) | |
tree | f182933a4e5e381d402a1a266d980d0182e58d58 /source3/param | |
parent | 5f60855ba2eb822dcb867378ff09278c42931b89 (diff) | |
download | samba-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')
-rw-r--r-- | source3/param/loadparm.c | 16 |
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); } |