Skip to content

Commit 1bcfa97

Browse files
authored
Fix build failure with event-stream, rustix, and use-dev-tty (#955)
1 parent fe96fef commit 1bcfa97

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

.github/workflows/crossterm_test.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
continue-on-error: ${{ matrix.can-fail }}
6969
- name: Test no default features with use-dev-tty feature enabled
7070
if: matrix.os != 'windows-2019'
71-
run: cargo test --no-default-features --features "use-dev-tty events bracketed-paste" -- --nocapture --test-threads 1
71+
run: cargo test --no-default-features --features "use-dev-tty events event-stream bracketed-paste" -- --nocapture --test-threads 1
7272
continue-on-error: ${{ matrix.can-fail }}
7373
- name: Test no default features with windows feature enabled
7474
if: matrix.os == 'windows-2019'

src/event/source/unix/tty.rs

+3
Original file line numberDiff line numberDiff line change
@@ -185,7 +185,10 @@ impl EventSource for UnixInternalEventSource {
185185

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

0 commit comments

Comments
 (0)