mirror of
https://github.com/cloud-hypervisor/cloud-hypervisor.git
synced 2026-08-05 02:19:16 +00:00
vmm: use the SIGWINCH listener for TTYs too
Previously, we were only using it for PTYs, because for PTYs there's no alternative. But since we have to have it for PTYs anyway, if we also use it for TTYs, we can eliminate all of the code that handled SIGWINCH for TTYs. Signed-off-by: Alyssa Ross <hi@alyssa.is>
This commit is contained in:
committed by
Rob Bradford
parent
e9841db486
commit
38a1b45783
@@ -1928,6 +1928,12 @@ impl DeviceManager {
|
||||
// SAFETY: stdout is valid and owned solely by us.
|
||||
let stdout = unsafe { File::from_raw_fd(stdout) };
|
||||
|
||||
// SAFETY: FFI call. Trivially safe.
|
||||
if unsafe { libc::isatty(libc::STDOUT_FILENO) } == 1 {
|
||||
self.listen_for_sigwinch_on_tty(stdout.try_clone().unwrap())
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
// If an interactive TTY then we can accept input
|
||||
// SAFETY: FFI call. Trivially safe.
|
||||
if unsafe { libc::isatty(libc::STDIN_FILENO) == 1 } {
|
||||
|
||||
Reference in New Issue
Block a user