mirror of
https://github.com/jarun/nnn.git
synced 2024-11-24 11:51:27 +00:00
Fix #34: use ~75% of max open file descs
This commit is contained in:
parent
75e3118acf
commit
16f0054b48
6
nnn.c
6
nnn.c
|
@ -245,11 +245,9 @@ max_openfds()
|
||||||
limit = rl.rlim_cur;
|
limit = rl.rlim_cur;
|
||||||
rl.rlim_cur = rl.rlim_max;
|
rl.rlim_cur = rl.rlim_max;
|
||||||
|
|
||||||
|
/* Return ~75% of max possible */
|
||||||
if (setrlimit(RLIMIT_NOFILE, &rl) == 0)
|
if (setrlimit(RLIMIT_NOFILE, &rl) == 0)
|
||||||
return rl.rlim_max - 64;
|
return (rl.rlim_max - (rl.rlim_max >> 2));
|
||||||
|
|
||||||
if (limit > 128)
|
|
||||||
return limit - 64;
|
|
||||||
|
|
||||||
return 32;
|
return 32;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue