diff --git a/ircd/fs.cc b/ircd/fs.cc index 1cb4ff844..4e4ef10bd 100644 --- a/ircd/fs.cc +++ b/ircd/fs.cc @@ -101,9 +101,13 @@ try { rlimit rlim[2] {0}; syscall(getrlimit, RLIMIT_NOFILE, &rlim[0]); + rlim[1] = rlim[0]; rlim[1].rlim_cur = std::max(rlim[1].rlim_cur, ulong(fs::rlimit_nofile)); rlim[1].rlim_cur = std::min(rlim[1].rlim_cur, rlim[1].rlim_max); + if(rlim[0].rlim_cur == rlim[1].rlim_cur) + return; + syscall(setrlimit, RLIMIT_NOFILE, &rlim[1]); log::info {