Skip to content

Commit

Permalink
address ci
Browse files Browse the repository at this point in the history
  • Loading branch information
hoanga committed Oct 1, 2023
1 parent bcb4aa6 commit c6423eb
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/poll.rs
Original file line number Diff line number Diff line change
Expand Up @@ -471,11 +471,17 @@ mod notify {
/// Creates a new notification pipe.
pub(super) fn new() -> io::Result<Self> {
#[cfg(not(target_os = "haiku"))]
let pipe_with = pipe_with(PipeFlags::CLOEXEC).ok();
let (read_pipe, write_pipe) = pipe_with(PipeFlags::CLOEXEC).or_else(|_| {
let (read_pipe, write_pipe) = pipe()?;
fcntl_setfd(&read_pipe, fcntl_getfd(&read_pipe)? | FdFlags::CLOEXEC)?;
fcntl_setfd(&write_pipe, fcntl_getfd(&write_pipe)? | FdFlags::CLOEXEC)?;
io::Result::Ok((read_pipe, write_pipe))
})?;

#[cfg(target_os = "haiku")]
let pipe_with = None;

#[cfg(target_os = "haiku")]
let (read_pipe, write_pipe) = pipe_with.unwrap_or_else(|| {
let (read_pipe, write_pipe) = pipe()?;
fcntl_setfd(&read_pipe, fcntl_getfd(&read_pipe)? | FdFlags::CLOEXEC)?;
Expand Down

0 comments on commit c6423eb

Please sign in to comment.