diff --git a/Cargo.toml b/Cargo.toml index bcca102820..d640d4d4f8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,7 +29,7 @@ targets = [ [dependencies] libc = { version = "=0.2.175", features = ["extra_traits"] } -bitflags = "2.3.3" +bitflags = "2.4" cfg-if = "1.0" pin-utils = { version = "0.1.0", optional = true } memoffset = { version = "0.9", optional = true } @@ -78,6 +78,15 @@ parking_lot = "0.12" rand = "0.9" tempfile = "3.7.1" semver = "1.0.7" + +# parking_lot_core and lock_api are indirect dependencies, so they normally should +# not appear here. However, we include them because we want Cargo to pick the exact +# version that we choose here when resolving dependencies. Newer versions of them +# require MSRV 1.71, our current MSRV is 1.69. +parking_lot_core = "=0.9.11" +lock_api = "=0.4.13" + +# To make IDE/LSP work better nix = { path = ".", features = ["acct", "aio", "dir", "env", "event", "fanotify", "feature", "fs", "hostname", "inotify", "ioctl", "kmod", "mman", "mount", "mqueue", "net", "personality", "poll", "pthread", "ptrace", "quota", "process", "reboot", diff --git a/src/fcntl.rs b/src/fcntl.rs index 6504c1dcf2..4b22744749 100644 --- a/src/fcntl.rs +++ b/src/fcntl.rs @@ -1041,8 +1041,10 @@ pub struct Flock(T); impl Drop for Flock { fn drop(&mut self) { let res = Errno::result(unsafe { libc::flock(self.0.as_raw_fd(), libc::LOCK_UN) }); - if res.is_err() && !std::thread::panicking() { - panic!("Failed to remove flock: {}", res.unwrap_err()); + if let Err(e) = res { + if !std::thread::panicking() { + panic!("Failed to remove flock: {}", e); + } } } }