From d965259685205e5509a6886c64d8ea9db1135e39 Mon Sep 17 00:00:00 2001 From: Alexander Thaller Date: Sun, 3 Jan 2021 00:39:12 +0100 Subject: [PATCH] Fix fcntl for FreeBSD Need to use the right cfg option for the conditional compilation. target_os is the right option to use when targeting FreeBSD. target_env was used before which seems to be a typo. --- src/fcntl.rs | 4 ++-- test/test_fcntl.rs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/fcntl.rs b/src/fcntl.rs index 1581d3a702..d2242dacd6 100644 --- a/src/fcntl.rs +++ b/src/fcntl.rs @@ -20,7 +20,7 @@ use crate::sys::uio::IoVec; // For vmsplice target_os = "fuchsia", any(target_os = "wasi", target_env = "wasi"), target_env = "uclibc", - target_env = "freebsd" + target_os = "freebsd" ))] pub use self::posix_fadvise::*; @@ -587,7 +587,7 @@ pub fn fallocate( target_os = "fuchsia", any(target_os = "wasi", target_env = "wasi"), target_env = "uclibc", - target_env = "freebsd" + target_os = "freebsd" ))] mod posix_fadvise { use crate::errno::Errno; diff --git a/test/test_fcntl.rs b/test/test_fcntl.rs index 1e8b267843..5d1bafebe1 100644 --- a/test/test_fcntl.rs +++ b/test/test_fcntl.rs @@ -332,7 +332,7 @@ mod linux_android { target_os = "fuchsia", any(target_os = "wasi", target_env = "wasi"), target_env = "uclibc", - target_env = "freebsd"))] + target_os = "freebsd"))] mod test_posix_fadvise { use tempfile::NamedTempFile;