mirror of
https://github.com/jarun/nnn.git
synced 2025-03-12 17:54:04 +00:00
Fix #34: use ~75% of max open file descs
This commit is contained in:
parent
75e3118acf
commit
16f0054b48
1 changed files with 2 additions and 4 deletions
6
nnn.c
6
nnn.c
|
@ -245,11 +245,9 @@ max_openfds()
|
|||
limit = rl.rlim_cur;
|
||||
rl.rlim_cur = rl.rlim_max;
|
||||
|
||||
/* Return ~75% of max possible */
|
||||
if (setrlimit(RLIMIT_NOFILE, &rl) == 0)
|
||||
return rl.rlim_max - 64;
|
||||
|
||||
if (limit > 128)
|
||||
return limit - 64;
|
||||
return (rl.rlim_max - (rl.rlim_max >> 2));
|
||||
|
||||
return 32;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue