diff --git a/src/env_universal_common.rs b/src/env_universal_common.rs index a05fbf474..2d2d01bd6 100644 --- a/src/env_universal_common.rs +++ b/src/env_universal_common.rs @@ -447,7 +447,7 @@ impl EnvUniversal { Err(nix::Error::EINTR) => continue, Err(err) => { if !O_EXLOCK.is_empty() { - if flags.intersects(O_EXLOCK) + if flags.contains(O_EXLOCK) && [nix::Error::ENOTSUP, nix::Error::EOPNOTSUPP].contains(&err) { // Filesystem probably does not support locking. Give up on locking. diff --git a/src/io.rs b/src/io.rs index c57c53e03..eb00e3583 100644 --- a/src/io.rs +++ b/src/io.rs @@ -669,7 +669,7 @@ impl IoChain { self.push(Arc::new(IoFile::new(spec.fd, fd))); } Err(err) => { - if oflags.intersects(OFlag::O_EXCL) && err == nix::Error::EEXIST { + if oflags.contains(OFlag::O_EXCL) && err == nix::Error::EEXIST { FLOGF!(warning, NOCLOB_ERROR, spec.target); } else { if should_flog!(warning) {