Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: build failure with event-stream, rustix, and use-dev-tty #955

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading