Skip to content

Commit

Permalink
fix macOS and android CI
Browse files Browse the repository at this point in the history
  • Loading branch information
satakuma committed Nov 3, 2023
1 parent 6b5dfcf commit f41dcd8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 3 additions & 1 deletion tokio/src/net/unix/pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1326,7 +1326,9 @@ fn is_pipe(fd: BorrowedFd<'_>) -> io::Result<bool> {
if r == -1 {
Err(io::Error::last_os_error())
} else {
Ok((stat.st_mode & libc::S_IFMT) == libc::S_IFIFO)
// on some platforms `st_mode` is larger than `S_IFMT` and `S_IFIFO`.
#[allow(clippy::useless_conversion)]
Ok((stat.st_mode & libc::S_IFMT) == libc::S_IFIFO.into())
}
}

Expand Down
3 changes: 2 additions & 1 deletion tokio/tests/net_unix_pipe.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use tokio_test::{assert_err, assert_ok, assert_pending, assert_ready_ok};
use std::fs::File;
use std::io;
use std::os::unix::fs::OpenOptionsExt;
use std::os::unix::io::{AsRawFd, FromRawFd, OwnedFd};
use std::os::unix::io::AsRawFd;
use std::path::{Path, PathBuf};

/// Helper struct which will clean up temporary files once dropped.
Expand Down Expand Up @@ -489,6 +489,7 @@ async fn anon_pipe_spawn_echo() -> std::io::Result<()> {
#[cfg(target_os = "linux")]
async fn anon_pipe_from_owned_fd() -> std::io::Result<()> {
use nix::fcntl::OFlag;
use std::os::unix::io::{FromRawFd, OwnedFd};

const DATA: &[u8] = b"this is some data to write to the pipe";

Expand Down

0 comments on commit f41dcd8

Please sign in to comment.