From ed3fdaa6652a209b5c3a6c6db9c561a0ea92f553 Mon Sep 17 00:00:00 2001 From: Xiretza Date: Sun, 16 Apr 2023 17:56:19 +0000 Subject: [PATCH] Change read_blocked parameter type to RawFd for clarity --- fish-rust/src/common.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 {