Fix reconciliation expectations and strict Clippy checks
This commit is contained in:
1 parent
feec06bc41
commit
a85a4e1184
4 files changed
+49
-21
No files matched your search
@@ -40,11 +40,7 @@ pub fn apply() -> Result<()> {
|
||||
pub fn apply() -> Result<()> {
|
||||
// Darwin rejects finite AS/DATA limits. The parent enforces a sampled RSS
|
||||
// budget there; retain the CPU limit and bounded path-free transport here.
|
||||
for (resource, maximum) in [
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
(libc::RLIMIT_AS, MEMORY_BYTES as libc::rlim_t),
|
||||
(libc::RLIMIT_CPU, 30 as libc::rlim_t),
|
||||
] {
|
||||
let set_limit = |resource, maximum| -> Result<()> {
|
||||
let value = libc::rlimit {
|
||||
rlim_cur: maximum,
|
||||
rlim_max: maximum,
|
||||
@@ -55,8 +51,11 @@ pub fn apply() -> Result<()> {
|
||||
unsafe { libc::setrlimit(resource, &value) } == 0,
|
||||
"Cannot install extraction resource limit"
|
||||
);
|
||||
}
|
||||
Ok(())
|
||||
Ok(())
|
||||
};
|
||||
#[cfg(not(target_os = "macos"))]
|
||||
set_limit(libc::RLIMIT_AS, MEMORY_BYTES as libc::rlim_t)?;
|
||||
set_limit(libc::RLIMIT_CPU, 30 as libc::rlim_t)
|
||||
}
|
||||
|
||||
#[cfg(not(any(windows, unix)))]
|
||||
|
||||
Reference in new issue
Block a user