diff --git a/fish-rust/src/common.rs b/fish-rust/src/common.rs index b14ac97d9..440856b49 100644 --- a/fish-rust/src/common.rs +++ b/fish-rust/src/common.rs @@ -1433,7 +1433,7 @@ fn can_be_encoded(wc: char) -> bool { /// Call read, blocking and repeating on EINTR. Exits on EAGAIN. /// \return the number of bytes read, or 0 on EOF. On EAGAIN, returns -1 if nothing was read. -pub fn read_blocked(fd: i32, mut buf: &mut [u8]) -> isize { +pub fn read_blocked(fd: RawFd, mut buf: &mut [u8]) -> isize { loop { let res = unsafe { libc::read(fd, std::ptr::addr_of_mut!(buf).cast(), buf.len()) }; if res < 0 && errno::errno().0 == EINTR {