Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Dead_Mozay:1C
postgresql10
00011-max_files_per_process.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 00011-max_files_per_process.patch of Package postgresql10
diff --git a/src/backend/storage/file/fd.c b/src/backend/storage/file/fd.c index 8dd51f1..8de9695 100644 --- a/src/backend/storage/file/fd.c +++ b/src/backend/storage/file/fd.c @@ -828,6 +828,13 @@ count_usable_fds(int max_to_probe, int *usable_fds, int *already_open) ereport(WARNING, (errmsg("getrlimit failed: %m"))); #endif /* HAVE_GETRLIMIT */ + int fdTest = 0; +#ifdef WIN32 + //we have error on Windows7 with max_files_per_process > 1200 when dup(0) - stdin + //make test on postgresql.conf file + fdTest = _open(ConfigFileName, _O_RDONLY); + if (fdTest < 0) fdTest = 0;// = stdin if error open +#endif /* dup until failure or probe limit reached */ for (;;) { @@ -843,7 +850,7 @@ count_usable_fds(int max_to_probe, int *usable_fds, int *already_open) break; #endif - thisfd = dup(0); + thisfd = dup(fdTest); if (thisfd < 0) { /* Expect EMFILE or ENFILE, else it's fishy */ @@ -869,7 +876,8 @@ count_usable_fds(int max_to_probe, int *usable_fds, int *already_open) /* release the files we opened */ for (j = 0; j < used; j++) close(fd[j]); - + + if (fdTest>0) _close(fdTest); pfree(fd); /*
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor