0
0
Fork 0
mirror of https://github.com/matrix-construct/construct synced 2024-11-26 08:42:34 +01:00

ircd::fs: Condition to skip setrlimit(2) and infolog message.

This commit is contained in:
Jason Volk 2020-04-18 18:07:52 -07:00
parent 13ea8b0ca0
commit 9fce3c6ca6

View file

@ -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
{