From bc58324925bcbfca6e41606cfbb4bb9756794c5c Mon Sep 17 00:00:00 2001 From: Austin Schey Date: Sat, 14 Dec 2024 16:57:06 -0800 Subject: [PATCH] fix: fix build failure with event-stream, rustix, and use-dev-tty --- .github/workflows/crossterm_test.yml | 2 +- src/event/source/unix/tty.rs | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/crossterm_test.yml b/.github/workflows/crossterm_test.yml index 9088af51..bde4d37b 100644 --- a/.github/workflows/crossterm_test.yml +++ b/.github/workflows/crossterm_test.yml @@ -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' diff --git a/src/event/source/unix/tty.rs b/src/event/source/unix/tty.rs index 03d76b40..9401a54e 100644 --- a/src/event/source/unix/tty.rs +++ b/src/event/source/unix/tty.rs @@ -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 {}