From 9d5c5a6410cba27d709fa270d0194549506d1f98 Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Tue, 22 Aug 2023 11:03:48 +0100 Subject: [PATCH] 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 --- vmm/src/sigwinch_listener.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/vmm/src/sigwinch_listener.rs b/vmm/src/sigwinch_listener.rs index 049dc077d..c4ef3119b 100644 --- a/vmm/src/sigwinch_listener.rs +++ b/vmm/src/sigwinch_listener.rs @@ -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();