Set an upper limit on concurrent FDs

I don't have the time nor will to look into it properly.
This commit is contained in:
Přemysl Eric Janouch 2021-07-06 17:25:25 +02:00
parent 4be24e17c3
commit 8d7a055b08
Signed by: p
GPG Key ID: A0420B94F92B9493
1 changed files with 4 additions and 0 deletions

View File

@ -2014,6 +2014,10 @@ main (int argc, char *argv[])
else
{
limit.rlim_cur = limit.rlim_max;
// But too much may be seriously detrimental to function
limit.rlim_cur = MIN (limit.rlim_cur, 1 << 16);
if (setrlimit (RLIMIT_NOFILE, &limit))
print_warning ("%s: %s", "setrlimit failed", strerror (errno));
}