vmm: sigwinch_listener: Remove unncessary mut from reference

warning: this argument is a mutable reference, but not used mutably
   --> vmm/src/sigwinch_listener.rs:121:38
    |
121 | fn set_foreground_process_group(tty: &mut File) -> io::Result<()> {
    |                                      ^^^^^^^^^ help: consider changing to: `&File`
    |
    = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#needless_pass_by_ref_mut

Signed-off-by: Rob Bradford <rbradford@rivosinc.com>
This commit is contained in:
Rob Bradford 2023-08-22 11:03:48 +01:00 committed by Rob Bradford
parent 8d072fef15
commit 9d5c5a6410

View File

@ -118,7 +118,7 @@ unsafe fn close_unused_fds(keep_fds: &mut [RawFd]) {
}
}
fn set_foreground_process_group(tty: &mut File) -> io::Result<()> {
fn set_foreground_process_group(tty: &File) -> io::Result<()> {
// SAFETY: trivially safe.
let my_pgrp = unsafe { getpgrp() };
// SAFETY: we have borrowed tty.
@ -155,7 +155,7 @@ fn set_foreground_process_group(tty: &mut File) -> io::Result<()> {
Ok(())
}
fn sigwinch_listener_main(seccomp_filter: BpfProgram, tx: File, mut tty: File) -> ! {
fn sigwinch_listener_main(seccomp_filter: BpfProgram, tx: File, tty: File) -> ! {
// SAFETY: any references to these file descriptors are
// unreachable, because this function never returns.
unsafe {
@ -172,7 +172,7 @@ fn sigwinch_listener_main(seccomp_filter: BpfProgram, tx: File, mut tty: File) -
register_signal_handler(SIGWINCH, sigwinch_handler).unwrap();
set_foreground_process_group(&mut tty).unwrap();
set_foreground_process_group(&tty).unwrap();
drop(tty);
notify();