mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2024-12-22 05:35:20 +00:00
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:
parent
8d072fef15
commit
9d5c5a6410
@ -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.
|
// SAFETY: trivially safe.
|
||||||
let my_pgrp = unsafe { getpgrp() };
|
let my_pgrp = unsafe { getpgrp() };
|
||||||
// SAFETY: we have borrowed tty.
|
// SAFETY: we have borrowed tty.
|
||||||
@ -155,7 +155,7 @@ fn set_foreground_process_group(tty: &mut File) -> io::Result<()> {
|
|||||||
Ok(())
|
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
|
// SAFETY: any references to these file descriptors are
|
||||||
// unreachable, because this function never returns.
|
// unreachable, because this function never returns.
|
||||||
unsafe {
|
unsafe {
|
||||||
@ -172,7 +172,7 @@ fn sigwinch_listener_main(seccomp_filter: BpfProgram, tx: File, mut tty: File) -
|
|||||||
|
|
||||||
register_signal_handler(SIGWINCH, sigwinch_handler).unwrap();
|
register_signal_handler(SIGWINCH, sigwinch_handler).unwrap();
|
||||||
|
|
||||||
set_foreground_process_group(&mut tty).unwrap();
|
set_foreground_process_group(&tty).unwrap();
|
||||||
drop(tty);
|
drop(tty);
|
||||||
|
|
||||||
notify();
|
notify();
|
||||||
|
Loading…
Reference in New Issue
Block a user