Skip to content

Commit

Permalink
fix: fix build failure with event-stream, rustix, and use-dev-tty
Browse files Browse the repository at this point in the history
  • Loading branch information
aschey committed Dec 15, 2024
1 parent fc8f977 commit 798eaa9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/crossterm_test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ jobs:
continue-on-error: ${{ matrix.can-fail }}
- name: Test no default features with use-dev-tty feature enabled
if: matrix.os != 'windows-2019'
run: cargo test --no-default-features --features "use-dev-tty events bracketed-paste" -- --nocapture --test-threads 1
run: cargo test --no-default-features --features "use-dev-tty events event-stream bracketed-paste" -- --nocapture --test-threads 1
continue-on-error: ${{ matrix.can-fail }}
- name: Test no default features with windows feature enabled
if: matrix.os == 'windows-2019'
Expand Down
3 changes: 3 additions & 0 deletions src/event/source/unix/tty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,10 @@ impl EventSource for UnixInternalEventSource {

#[cfg(feature = "event-stream")]
if fds[2].revents & POLLIN != 0 {
#[cfg(feature = "libc")]
let fd = FileDesc::new(self.wake_pipe.receiver.as_raw_fd(), false);
#[cfg(not(feature = "libc"))]
let fd = FileDesc::Borrowed(self.wake_pipe.receiver.as_fd());
// drain the pipe
while read_complete(&fd, &mut [0; 1024])? != 0 {}

Expand Down

0 comments on commit 798eaa9

Please sign in to comment.