Browse Source

Don't set RLIM_INFINITY as rlim_cur for RLIMIT_NOFILE, use 4096 if rlim_cur < 4096 and rlim_max = inf

personal/stbuehler/wip
Stefan Bühler 12 years ago
parent
commit
69f4ad2b4b
  1. 4
      src/main/server.c

4
src/main/server.c

@ -154,6 +154,10 @@ liServer* li_server_new(const gchar *module_dir, gboolean module_resident) {
ERROR(srv, "couldn't get 'max filedescriptors': %s", g_strerror(errno));
} else {
max_fds = rlim.rlim_cur;
if (RLIM_INFINITY == rlim.rlim_max) {
/* don't set RLIM_INFINITY as rlim_cur - doesn't work */
rlim.rlim_max = 4096;
}
if (rlim.rlim_cur < rlim.rlim_max) {
/* go for maximum */
rlim.rlim_cur = rlim.rlim_max;

Loading…
Cancel
Save