Skip to content

Commit d965259

Browse files
author
Alexander Thaller
committed
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.
1 parent 8cff207 commit d965259

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/fcntl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ use crate::sys::uio::IoVec; // For vmsplice
2020
target_os = "fuchsia",
2121
any(target_os = "wasi", target_env = "wasi"),
2222
target_env = "uclibc",
23-
target_env = "freebsd"
23+
target_os = "freebsd"
2424
))]
2525
pub use self::posix_fadvise::*;
2626

@@ -587,7 +587,7 @@ pub fn fallocate(
587587
target_os = "fuchsia",
588588
any(target_os = "wasi", target_env = "wasi"),
589589
target_env = "uclibc",
590-
target_env = "freebsd"
590+
target_os = "freebsd"
591591
))]
592592
mod posix_fadvise {
593593
use crate::errno::Errno;

test/test_fcntl.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -332,7 +332,7 @@ mod linux_android {
332332
target_os = "fuchsia",
333333
any(target_os = "wasi", target_env = "wasi"),
334334
target_env = "uclibc",
335-
target_env = "freebsd"))]
335+
target_os = "freebsd"))]
336336
mod test_posix_fadvise {
337337

338338
use tempfile::NamedTempFile;

0 commit comments

Comments
 (0)