Fix build failure with event-stream, rustix, and use-dev-tty (#955)

This commit is contained in:
Austin Schey 2025-02-02 02:15:45 -08:00 committed by GitHub
parent fe96fefd41
commit 1bcfa9729c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 1 deletions

View File

@ -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'

View File

@ -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 {}