From: Alex Crichton Date: Thu, 1 Jun 2017 19:24:51 +0000 (-0700) Subject: Ignore ENOTSUP in file locking on Linux too X-Git-Tag: archive/raspbian/0.35.0-2+rpi1~3^2^2^2^2^2^2^2~22^2~9^2~12^2 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=7e3e9b2d01a82fc94cc8c9d19e623ab7d778f01a;p=cargo.git Ignore ENOTSUP in file locking on Linux too Apparently there are some filesystems that return this! Closes #4096 --- diff --git a/src/cargo/util/flock.rs b/src/cargo/util/flock.rs index 1be77b2d8..505a88a00 100644 --- a/src/cargo/util/flock.rs +++ b/src/cargo/util/flock.rs @@ -271,10 +271,11 @@ fn acquire(config: &Config, match try() { Ok(()) => return Ok(()), - // Like above, where we ignore file locking on NFS mounts on Linux, we - // do the same on OSX here. Note that ENOTSUP is an OSX_specific - // constant. - #[cfg(target_os = "macos")] + // In addition to ignoring NFS which is commonly not working we also + // just ignore locking on filesystems that look like they don't + // implement file locking. We detect that here via the return value of + // locking (e.g. inspecting errno). + #[cfg(unix)] Err(ref e) if e.raw_os_error() == Some(libc::ENOTSUP) => return Ok(()), #[cfg(target_os = "linux")]