Skip to content

Commit

Permalink
[temp] switch default to check_pipe
Browse files Browse the repository at this point in the history
  • Loading branch information
belovdv committed Mar 14, 2023
1 parent 39b2790 commit 85fc976
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ edition = "2018"
libc = "0.2.50"

[features]
check_pipe = []
do_not_check_pipe = []

[dev-dependencies]
futures = "0.1"
Expand Down
4 changes: 2 additions & 2 deletions src/unix.rs
Original file line number Diff line number Diff line change
Expand Up @@ -379,7 +379,7 @@ impl Helper {
}

fn check_fd(fd: c_int) -> io::Result<()> {
#[cfg(feature = "check_pipe")]
#[cfg(not(feature = "do_not_check_pipe"))]
unsafe {
let mut stat = mem::zeroed();
if libc::fstat(fd, &mut stat) == -1 {
Expand All @@ -397,7 +397,7 @@ fn check_fd(fd: c_int) -> io::Result<()> {
Err(io::Error::last_os_error()) //
}
}
#[cfg(not(feature = "check_pipe"))]
#[cfg(feature = "do_not_check_pipe")]
unsafe {
match libc::fcntl(fd, libc::F_GETFD) {
r if r == -1 => Err(io::Error::new(
Expand Down

0 comments on commit 85fc976

Please sign in to comment.