redox unused_mut follow-up
This commit is contained in:
@@ -74,7 +74,7 @@ impl Dev {
|
||||
Ok(res as c_int)
|
||||
}
|
||||
|
||||
unsafe fn write_ioctl<T: IoctlData>(&self, mut buf: IoctlBuffer, func: u64) -> Result<c_int> {
|
||||
unsafe fn write_ioctl<T: IoctlData>(&self, buf: IoctlBuffer, func: u64) -> Result<c_int> {
|
||||
let data = unsafe { buf.read::<T>() }?;
|
||||
let wire = unsafe { data.write() };
|
||||
let res = redox_rt::sys::sys_call_wo(
|
||||
|
||||
@@ -21,8 +21,8 @@ pub unsafe extern "C" fn redox_fpath(fd: c_int, buf: *mut c_void, count: size_t)
|
||||
pub fn pipe2(flags: usize) -> syscall::error::Result<[c_int; 2]> {
|
||||
let read_flags = flags | O_RDONLY;
|
||||
let write_flags = flags | O_WRONLY;
|
||||
let mut read_fd = FdGuard::open("/scheme/pipe", read_flags)?;
|
||||
let mut write_fd = read_fd.dup(b"write")?;
|
||||
let read_fd = FdGuard::open("/scheme/pipe", read_flags)?;
|
||||
let write_fd = read_fd.dup(b"write")?;
|
||||
write_fd.fcntl(F_SETFL, write_flags)?;
|
||||
write_fd.fcntl(F_SETFD, write_flags)?;
|
||||
|
||||
|
||||
@@ -1414,8 +1414,8 @@ impl Pal for Sys {
|
||||
Ok(())
|
||||
}
|
||||
|
||||
fn waitpid(mut pid: pid_t, stat_loc: Option<Out<'_, c_int>>, options: c_int) -> Result<pid_t> {
|
||||
let mut res = None;
|
||||
fn waitpid(pid: pid_t, stat_loc: Option<Out<'_, c_int>>, options: c_int) -> Result<pid_t> {
|
||||
let res = None;
|
||||
let mut status = 0;
|
||||
|
||||
let options = usize::try_from(options)
|
||||
|
||||
@@ -149,7 +149,7 @@ pub fn dir_path_and_fd_path(socket_path: &str) -> Result<(String, String)> {
|
||||
let full_path = canonicalize_with_cwd_internal(cwd_guard.as_deref(), socket_path)?;
|
||||
|
||||
let redox_path = RedoxPath::from_absolute(&full_path).ok_or(Error::new(EINVAL))?;
|
||||
let (_, mut ref_path) = redox_path.as_parts().ok_or(Error::new(EINVAL))?;
|
||||
let (_, ref_path) = redox_path.as_parts().ok_or(Error::new(EINVAL))?;
|
||||
if ref_path.as_ref().is_empty() {
|
||||
return Err(Error::new(EINVAL));
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ impl PalSignal for Sys {
|
||||
// let fd = FdGuard::new(redox_rt::sys::open(path, syscall::O_RDONLY | syscall::O_CLOEXEC)?);
|
||||
// let count = syscall::read(*fd, &mut spec)?;
|
||||
|
||||
let mut spec = syscall::ITimerSpec::default();
|
||||
let spec = syscall::ITimerSpec::default();
|
||||
out.it_interval.tv_sec = spec.it_interval.tv_sec as time_t;
|
||||
out.it_interval.tv_usec = spec.it_interval.tv_nsec / 1000;
|
||||
out.it_value.tv_sec = spec.it_value.tv_sec as time_t;
|
||||
|
||||
@@ -562,7 +562,7 @@ impl PalSocket for Sys {
|
||||
let path = format!("{}", str::from_utf8(addr).unwrap());
|
||||
log::trace!("bind(): path: {:?}", path);
|
||||
|
||||
let (dir_path, mut fd_path) = dir_path_and_fd_path(&path)?;
|
||||
let (dir_path, fd_path) = dir_path_and_fd_path(&path)?;
|
||||
|
||||
redox_rt::sys::sys_call_wo(
|
||||
socket as usize,
|
||||
@@ -636,7 +636,7 @@ impl PalSocket for Sys {
|
||||
|
||||
let addr =
|
||||
unsafe { slice::from_raw_parts(&data.sun_path as *const _ as *const u8, len) };
|
||||
let mut path = format!("{}", str::from_utf8(addr).unwrap());
|
||||
let path = format!("{}", str::from_utf8(addr).unwrap());
|
||||
log::trace!("connect(): path: {:?}", path);
|
||||
|
||||
let (_, fd_path) = dir_path_and_fd_path(&path)?;
|
||||
@@ -1115,8 +1115,8 @@ impl PalSocket for Sys {
|
||||
// on any I/O performed. So we don't need to mark this as
|
||||
// nonblocking.
|
||||
|
||||
let mut fd0 = listener.dup(b"connect")?;
|
||||
let mut fd1 = listener.dup(b"listen")?;
|
||||
let fd0 = listener.dup(b"connect")?;
|
||||
let fd1 = listener.dup(b"listen")?;
|
||||
|
||||
sv[0] = fd0.take() as c_int;
|
||||
sv[1] = fd1.take() as c_int;
|
||||
@@ -1129,7 +1129,7 @@ impl PalSocket for Sys {
|
||||
// on any I/O performed. So we don't need to mark this as
|
||||
// nonblocking.
|
||||
|
||||
let mut fd0 = listener.dup(b"connect")?;
|
||||
let fd0 = listener.dup(b"connect")?;
|
||||
|
||||
sv[0] = fd0.take() as c_int;
|
||||
sv[1] = listener.take() as c_int;
|
||||
|
||||
Reference in New Issue
Block a user