diff --git a/src/syscalls/mod.rs b/src/syscalls/mod.rs index 09c0a87444..62b46b7c9b 100644 --- a/src/syscalls/mod.rs +++ b/src/syscalls/mod.rs @@ -456,10 +456,10 @@ pub unsafe extern "C" fn sys_readv(fd: i32, iov: *const iovec, iovcnt: i32) -> i } let mut count: isize = 0; - let slice = unsafe { core::slice::from_raw_parts(iov, iovcnt.try_into().unwrap()) }; + let iovec_buffers = unsafe { core::slice::from_raw_parts(iov, iovcnt.try_into().unwrap()) }; - for i in slice { - let buf = unsafe { core::slice::from_raw_parts_mut(i.iov_base, i.iov_len) }; + for iovec_buf in iovec_buffers { + let buf = unsafe { core::slice::from_raw_parts_mut(iovec_buf.iov_base, iovec_buf.iov_len) }; let len = crate::fd::read(fd, buf).map_or_else( |e| -num::ToPrimitive::to_isize(&e).unwrap(), @@ -472,7 +472,7 @@ pub unsafe extern "C" fn sys_readv(fd: i32, iov: *const iovec, iovcnt: i32) -> i count += len; - if len < i.iov_len.try_into().unwrap() { + if len < iovec_buf.iov_len.try_into().unwrap() { return count; } } @@ -517,10 +517,10 @@ pub unsafe extern "C" fn sys_writev(fd: FileDescriptor, iov: *const iovec, iovcn } let mut count: isize = 0; - let slice = unsafe { core::slice::from_raw_parts(iov, iovcnt.try_into().unwrap()) }; + let iovec_buffers = unsafe { core::slice::from_raw_parts(iov, iovcnt.try_into().unwrap()) }; - for i in slice { - let buf = unsafe { core::slice::from_raw_parts(i.iov_base, i.iov_len) }; + for iovec_buf in iovec_buffers { + let buf = unsafe { core::slice::from_raw_parts(iovec_buf.iov_base, iovec_buf.iov_len) }; let len = crate::fd::write(fd, buf).map_or_else( |e| -num::ToPrimitive::to_isize(&e).unwrap(), @@ -533,7 +533,7 @@ pub unsafe extern "C" fn sys_writev(fd: FileDescriptor, iov: *const iovec, iovcn count += len; - if len < i.iov_len.try_into().unwrap() { + if len < iovec_buf.iov_len.try_into().unwrap() { return count; } }