Production sysctl_tuning hardening and upgrade-safe defaults
This commit is contained in:
@@ -71,6 +71,7 @@ impl Drop for FileLock {
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(unix)]
|
||||
fn is_stale_lock(path: &Path) -> anyhow::Result<bool> {
|
||||
let pid_raw = fs::read_to_string(path)?;
|
||||
let pid = match pid_raw.trim().parse::<u32>() {
|
||||
@@ -82,6 +83,11 @@ fn is_stale_lock(path: &Path) -> anyhow::Result<bool> {
|
||||
Ok(!Path::new(&proc_path).exists())
|
||||
}
|
||||
|
||||
#[cfg(not(unix))]
|
||||
fn is_stale_lock(_path: &Path) -> anyhow::Result<bool> {
|
||||
Ok(false)
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use super::*;
|
||||
|
||||
Reference in New Issue
Block a user