Don't ever decrease rlimit
In case the rlimit is already higher than the desired number, we leave it as-is.
This commit is contained in:
parent
f4f479d68f
commit
640d302345
|
|
@ -14,6 +14,9 @@ pub fn set_file_limit(n: u64) -> io::Result<u64> {
|
|||
return Err(io::Error::last_os_error());
|
||||
}
|
||||
}
|
||||
if rlim.rlim_cur >= n {
|
||||
return Ok(rlim.rlim_cur);
|
||||
}
|
||||
// Set the soft limit to the given value, up to the hard limit.
|
||||
rlim.rlim_cur = n.min(rlim.rlim_max);
|
||||
unsafe {
|
||||
|
|
|
|||
Loading…
Reference in New Issue